Fixes #2175: Fixes a crash when blender is in background mode or is used as bpy Python module

This commit is contained in:
Emad Aghajani
2022-05-03 02:26:45 -07:00
committed by Dion Moult
parent d4b2cc7f2c
commit 3f6d25ed43
@@ -131,6 +131,7 @@ for mod in modules.values():
def on_register(scene): def on_register(scene):
handler.setDefaultProperties(scene) handler.setDefaultProperties(scene)
if not bpy.app.background:
bpy.app.handlers.depsgraph_update_post.remove(on_register) bpy.app.handlers.depsgraph_update_post.remove(on_register)