-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Viewport Texture loosing node_path reference if SubViewport is SubScene root #84607
Comments
Note the included
Can't reproduce like that if only I can reproduce like this (same in v4.1.3.stable.official [f06b6836a] and v4.2.beta5.official [4c96e96]): |
You are right. I didn't realize that the open sub_viewport.tscn was also needed to reproduce. |
This is mainly due to #64388. Line 496 in 3e7f638
The |
Indeed, but it's a property of the ViewportTexture and hence it should probably be relative to the root of the scene the given ViewportTexture belongs to, not to the root of the scene the referenced Viewport belongs to.
Lines 491 to 506 in 3e7f638
but it's used as if it's relative to the ViewportTexture's local scene: Lines 176 to 180 in 3e7f638
Meaning currently there's an unspoken assumption that Viewport and ViewportTexture both belong to the same scene. But it's not guaranteed to be the case, as e.g. this issue clearly shows. For sure the current state is bad UX-wise. It either needs to be fixed (I'm not sure if there's anything preventing this 🤔), or if it's indeed meant to be unsupported then the user should be prevented / not allowed to get into situation like reported in here (making ViewportTexture refer to Viewport from different scene). Also the docs need clarification, it's not stated which scene root the godot/doc/classes/ViewportTexture.xml Lines 18 to 21 in 3e7f638
(@Rindbee To be clear: I'm not suggesting you should do any of this. I've mentioned you because I thought you'd be familiar with / interested in this. 🙃) |
It is relative to the If we allow the
In case 2 and 3, it may be difficult to determine when the target Lines 82 to 87 in e5bacbc
|
Godot version
v4.1.3.stable.official [f06b6836a]
System information
macOS Ventura 13.5.2 - Godot v4.1.3.stable - Forward+ renderer - Apple Silicon M1 Pro
Issue description
What doesn't work
If using the Path to a SubViewport, that is the root of its own Scene, as a viewport_path of a render texture this reference is lost after restarting the editor and hitting play/saving scene.
How should it work
The viewport_path should not be updated by the editor on load as the target node path is a valid SubViewport Node.
Workaround
If the SubViewport itself is not the root of a subscene, the editor does not loose reference. So the tree structure can be changed that this works.
This is working, though it's not obvious that the scene structure is relevant here and this will throw of users who are new to viewport textures.
Possible related issues
This might be related to issues in Godot 3:
#27790
#83898
Steps to reproduce
BrakingReference/Sprite3D::texture::viewport_path
is lost (you can git diff to see the change in reference or just see that the render texture is not rendered)Minimal reproduction project
Reproduction project is located here: https://github.com/nerdlibfront/godot-4.1-viewport-scene-issue
Or here:
ViewportSceneIssue.zipViewportSceneIssue.zipThe text was updated successfully, but these errors were encountered: