Repository: godot
Issue: Viewport update mode lost when nested under ViewportContainer
Labels: bug,topic:rendering,confirmed,topic:gui

**Godot version:**
3.0.6  (issue also present in 3.1 Alpha2)

**OS/device including version:**
macOS 10.13.6

**Issue description:**
When a `Viewport` is used with a `ViewportContainer`, its update mode (`render_target_update_mode` parameter) silently reverts back to "Always" whenever the project/scene is run or the scene tab is changed.

The culprit doesn't seem to be `Viewport` but `ViewportContainer`, as `Viewport`'s update mode sticks when used in other configurations, such as when set up to render to a `ViewportTexture` used by a `TextureRect`.

**Workarounds:**
Replacing ViewportContainer with a simple TextureRect+ViewportTexture combo avoids the issue.

**Why is this important if there's such a simple workaround?:**
This is a big deal, as one wouldn't notice the issue if a scene under a Viewport is set up as a static one that is configured to render only once (e.g. to convert a 3D model/scene to a 2D static image). A scene that is set up to render once would typically not be set up to change at all, and hence provide no visual indication to the developer that it is being re-rendered every frame, wasting CPU & GPU resources. (I personally didn't realize for quite awhile that my many instances of a home-made Label3D class -- to overcome Godot's lack of a Label3D class at the moment -- were being rendered every frame even though I set up Label3D to render each instance once and only once whenever either the text changes or the scene that uses it asks the text to be rendered in a different resolution. The only reason I noticed this is because of the parameter change that I kept seeing in version control diffs.)

Considering the impact it can cause on a deployed project, ViewportContainer should either be removed, documented better, or -- in my opinion -- should be left in without any documentation changes, but it should not force Viewport's update mode back to "Always".

**Steps to reproduce:**
Nest a Viewport under a ViewportContainer, set its "Update Mode" to "Once", then run the scene or switch to another scene tab in the editor and then go back to the original scene. Note the change of "Update Mode" back to "Always".

**Minimal reproduction project:**
The attached project below has two scenes in it. Both scenes have a cube that continuously rotates, but is set up to render only once. 

- `ViewportTexture.tscn` demonstrates the problem. When run, the expected behaviour is to see a stationary box, as the "Update Mode" was set to "Once" at the time the scene was created. But the cube rotates, and the Update Mode that is loaded is set to "Always". Set "Update Mode" to "Once" and run the scene again; note that it makes no difference, i.e. that you can still see the box rotate.

- `TextureRect.tscn` demonstrates a workaround to the problem where the Viewport is used to render to a ViewportTexture used by a `TextureRect`. In this case, the display doesn't update as the cube continues to rotate, as expected. I also added a little handler for the space bar on the keyboard to trigger a new snapshot (press space bar to take new snapshots of the cube).

[ViewportUpdateModeIssue.zip](https://github.com/godotengine/godot/files/2586540/ViewportUpdateModeIssue.zip)