In my Blueprint actor I need the previous iteration of a Render Target when I apply the Brush material to it. (Texture Type). After messing around in the code I have realized when you “Set” a Parameter for a Texture type it will automatically update it when you edit the source texture or material. Is there any way to make a duplicate without it referencing the source texture? I need it to stay the same version as when I initially set the texture. This is driving me wild, thank you for all and any help!
If that’s unclear please let me know. My ultimate goal is to have 3 or so previous versions of the Rendertarget texture. That way I can basically make an undo button with the saved texture.
Save all pixels of your render target as an array. If you want to go back just paint those pixels onto the render target
Use multiple render targets to create either timed snapshots of your render target / picture or create a snapshot after every modification or save the orignal at the beginning
Use multiple render targets to create multiple layers. Whenever you paint / modify you do this on a new render target. These render target will be stacked on top of each other. If you want to go back you delete the last render targets / layers.
So I’ve figured out that if I can save the Rendertargets, I could have three backups maybe. But now the question is…how do you save Rendertargets during runtime? That’s the next question for this method.
Alright this is super useful. However, in UE5 it seems that exporting RenderTargets as files is a huge pain in the neck? I will report back if I can get it to work. But even “Export Render Target” in realtime doesn’t seem to be working correctly.
I once created something similar. In this project the task was to display an actor via a render target BUT a few ticks/seconds delayed. For this I created a C++ class:
I actually have a friend that can do C++ too! I really appreciate you sharing your scripts.
What we ended up doing is that my friend who does C++ put these functions into a node for me, we got it running on the project and now I can call “ExportRenderTarget2DAsPNG”, which works with my variable RenderTargets. So we can now export those as textures, and use those textures in other parts of the game. Which is fantastic!