With the render_init handler, it is possible to delay a render indefinitely. E.G.:
def DelayRender20s(scene, *args):
print("Render requested.")
for i in range(20):
print(f"Beginning in {20-i} seconds")
time.sleep(1)
print("Now beginning render!")
bpy.app.handlers.render_init.append(DelayRender20s)
(I'm guessing this probably just gets called from a try/except block somewhere in the render operator.)
Is it possible to outright cancel a render once it's been requested/started by the user?
The use would be to check that a certain condition is met before letting a render proceed, possibly giving the user a choice between automatically fixing that condition or cancelling the render otherwise.
*ops.render.render(). If you'd like to have a shortcut like esc I don't think there is a way around a modal operator, otherwise you can just add a scene property and check whenever it's true to start the rendering I guess. Also there is therender_cancelhandler, might worth to check out. – brockmann Jun 18 '21 at 06:44