How to update the scene when exporting a RenderTarget from SceneCaptureComponent2D ?
I'm trying to iteratively save images of a mesh from different viewpoints.
To do that, I have a mesh of the object, attached to this mesh I have a SrpingArm and attached to that spring arm I have a SceneCaptureComponent2D. I iteratively (in a For loop) rotate the spring arm to have a different viewpoint and then save the image that the SceneCaptureComponent2D is filming by using the UKismetRenderingLibrary::ExportRenderTarget function.
It seems that, within the For loop, the scene doesn't get updated after the parameters changed. Which leads me to this question: When using a SceneCaptureComponent2D, how to be sure that the scene is up-to-date before exporting its RenderTarget into a png image ?
If you have any ideas what may go wrong, please feel free to tell, I've searching for a long time and I'm really running out of options right now. (ಥ﹏ಥ)
asked Sep 16 '18 at 09:28 AM in Rendering
My guess is that because it is in a loop, the loop does all its iterations before the next tick, and the next tick is what updates the scene capture to render again. So because it is all in a loop happening before the next tick the next tick doesnt happen for each loop and the render target doesnt update until after the loop is done.
That is just a guess but you can try using a separate index variable and running this every Tick and increment that variale so it loops over seceral ticks instead of all at once to see if my theory is correct.
answered Sep 16 '18 at 08:48 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here