Viewport Texture Data (Update)

panicqpanicq Posts: 67Member

Hey,

I'm creating an editor plugin and I need a way to snapshot the texture data coming from a viewport in a loop.
I need to do a lot of snapshots so I want to reuse the same viewport. In my tree I have a viewport and a camera as a child and in my tool in the loop for each iteration: I'm simply moving the camera and doing a GetTexture().Data on the viewport and finally saving the image as a png.

My issue is that all my saved images correspond to the same camera point of view. It's like if the viewport was not updating the render at each loop iteration.

Is there a way (like Camera.render in unity) to force the update of the render in the viewport ? If not what could I do ?

Thanks in advance !


Tags :

Comments

  • SIsilicon28SIsilicon28 Posts: 715Moderator

    Sadly, there is currently no way for the viewport to be manually updated. It can only update as frequently as each frame.

  • TwistedTwiglegTwistedTwigleg Posts: 2,666Admin
    edited June 24

    You can always make a proposal for this in the Godot proposal repository, assuming one does not already exist.

  • SIsilicon28SIsilicon28 Posts: 715Moderator
    edited June 24
  • panicqpanicq Posts: 67Member

    Hum ok that's very inconvenient :(

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file