I need my texture that I saved here → $Wall/SubViewportContainer/SubViewport.get_texture().get_image().save_png(“res://Landspace/Landscape_texture/splat_map/the_splatmap.png”)
to save without quitting . I want it to save when the scene is running. I have tried doing this in the editor as well and running it as a tool and it will save only if I run and quit the project. it doesn’t finish importing until after I have quit the project. I want to Import the Texture while its running , even if I have to Destroy the old one. Making a custom Landscape shader with Gdscript.
I ran into the same problem. I assume your application is loading all resources at startup?
In this case I recommend keeping a reference to the image you get from get_image() and also save it to disk. Then, you don’t need to load it during runtime (since it’s already in memor). If you need to destroy the image afterwards, just free the variable and call the delete function on your file path.
You can see my implementation here:
I am creating the image and saving it, but I do not load it until the game restarts. Instead, I use the image that’s already in memory. The key is to separate the image and the filepath during runtime and treat them separately.