I'm looking to write a script to print a message when the render is done.
if bpy.app.handlers.render_complete == True:
print("\a") # beep
print("Render complete!")
only that doesn't work when the render is finished.
I tried wrapping it in app handler but I just got errors
import os
import bpy
from pycl import print
from bpy.app.handlers import persistent
# clear the screen
os.system('cls')
@persistent
def my_handler(scene):
print("\a") # beep
print("Render done!!")
bpy.app.handlers.render_complete.append(my_handler)
Traceback (most recent call last): File "\Text", line 15, in my_handler File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\pyc l.py", line 33, in print console_print(*args, **kwargs) # to Python Console File "C:\Program Files\Blender Foundation\Blender 2.91\2.91\scripts\addons\pyc l.py", line 20, in console_print for a in context.screen.areas: AttributeError: 'NoneType' object has no attribute 'areas'
I've had a look at this post. Without a greater understanding of app handler, I'm not sure where I'm going wrong.
I've restarted Blender a couple of times and now have found that it was
from pycl import print
causing the error, simply removing it or commenting it out the script works fine.