My problem is I had to write custom modal Render Animation operator for my add-on because using the original one together with my add-on crashes Blender. My operator makes some changes in the scene, changes the current frame, launches
bpy.ops.render.render('INVOKE_DEFAULT', animation=False, write_still=True), waits until the render is finished with use of
bpy.app.handlers - and repeats this process until all the frames in the scene are rendered. The operator itself works fine, but once
bpy.ops.render.render is called with
True Blender somehow stores this choice in the memory and the original Blender's
Render Image button also starts to save the render result to the file after the render, although it should not by default. It is not so obvious and may ruin some user's progress so I would like to prevent it, if possible.
The question is - is there a way to set
write_still argument back to
False without another unnecessary call of the render operator? I've been thinking of changing it directly somewhere in the
bpy.types.RENDER_OT_render.properties but as you may know
bpy.ops.render.render() is not a Python operator and it is not registered in
For now the only solution I see is to remember original Render Samples and Scene Resolution settings, render just 1 pixel with 1 sample with
write_still=False and then set Scene settings back. But from my previous experience I know that such ultra-fast renders with changing Scene settings there and back may lead to crashes because of C internal errors which can not be handled from the Python API, and the probability is pretty high. So I hope there is a way to set
False in some proper way. Any suggestions?