Assume there is a viewport that "looks" at some Sprite2D.
This viewport's view is providing the texture for a Sprite3D by:
Sprite3D.texture = spriteViewport.get_texture()
It works fine, and the Sprite3D looks exactly like Sprite2D.
This effectively makes the Sprite3D's texture a "dynamic" one: if Sprite2D changes (or anything in the view of the viewport changes) these changes will be immediately reflected on Sprite3D.
While this is an intended behaviour of ViewportTexture, I would like to know if there is a way to make a "one and done" snap of that viewport's view. To render the dynamic ViewportTexture to a static Texture2D so that any subsequent changes in the viewport do not affect the Sprite3D anymore. Ideally without the use of resources or .png workarounds and in the form of a function akin to:
func updateTexture(viewport: Subviewport,sprite3D: Sprite3D)
<code that permanently redraws the texture of the sprite3D to whatever was in viewport's view>
The obvious solution is saving the "viewport view" as a .png and then assigning the .png to the Sprite3D's texture. However, it is computationally slow and takes extra space, creates extra files, i.e. a mess and I'd rather avoid it.
I've also tried creating a new Texture2D and then assigning the viewport texture to it like so:
newTex = Texture2D.new()
newTex = someViewport.get_texture()
It did not work. Any tips?
