You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a node tree with a Sprite3D that uses a ViewportTexture, referencing a child SubViewport. This node tree needs to be duplicated for the intended usage.
The issue is, when the tree gets duplicated, the SubViewport gets duplicated as well, but the reference ViewportTexture is using is the one on the original tree instead of the duplicate.
Steps to reproduce
Make a scene with the following structure:
Node3D
Sprite3D (assign the SubViewport below as the sprite)
SubViewport
Sprite2D
AnimationPlayer
On the animation player, make two animations: one to rotate clockwise (default), and another to rotate counter-clockwise.
Then make a script that duplicates the Sprite3D, adds the duplicate slightly to the side of the original, and make its animation player play the counter-clockwise one.
Nothing will happen. Because the SubViewport on the second is the same as the first. Evidenced by any animation changes on the first also being applied on the second.
Additionally, trying to assign the duplicate SubViewport on the second overrides the first.
Despite being checked by default, resource_local_to_scene doesn't seem to have any effect.
A solution with code would be to get the duplicated SubViewport's texture with get_texture() and assign it to the Sprite.
Tested versions
4.2.2
System information
Nobara Linux 39
Issue description
I have a node tree with a Sprite3D that uses a ViewportTexture, referencing a child SubViewport. This node tree needs to be duplicated for the intended usage.
The issue is, when the tree gets duplicated, the SubViewport gets duplicated as well, but the reference ViewportTexture is using is the one on the original tree instead of the duplicate.
Steps to reproduce
Make a scene with the following structure:
On the animation player, make two animations: one to rotate clockwise (default), and another to rotate counter-clockwise.
Then make a script that duplicates the Sprite3D, adds the duplicate slightly to the side of the original, and make its animation player play the counter-clockwise one.
Nothing will happen. Because the SubViewport on the second is the same as the first. Evidenced by any animation changes on the first also being applied on the second.
Additionally, trying to assign the duplicate SubViewport on the second overrides the first.
Despite being checked by default,
resource_local_to_scene
doesn't seem to have any effect.A solution with code would be to get the duplicated SubViewport's texture with
get_texture()
and assign it to the Sprite.Minimal reproduction project (MRP)
Viewport Duplicate Bug.zip
The text was updated successfully, but these errors were encountered: