I am trying to create a script that would render my scene multiple times (let's say, a hundred times), with only some minor changes after each render. What I am trying to do is to render something, then make a change, and then render again, and repeat this process. Right now, I currently face two problems
- How to ensure the rendering is first finished before any other changes are done? That means, render is commenced, finished, and then necessary changes are made to the scene? I already figured out that there exists a method in
bpy.app.handlers(bpy.app.handlers.render_complete()) that triggers when rendering is done, but so far I did not figure out how to make it work. I am not even sure this is exactly the function I need and. Either way, I am not really sure about what argument is needed since documentation doesn't mention anything specifically. - How to set a name for a file that is being rendered? Right now I am using OS library to rename a file after it is rendered (since the file is labelled as "" defaultly), but this seems like an extremely unreliable way to do it (also, it raises some other problems that might pop up later.


bpy.ops.render.render()will work, because it's synchronous - it hangs. The line below it will happen after the render finishes, so you can then safely edit the scene and render again. – Markus von Broady Apr 21 '22 at 09:52