prevent picker register on background mode

gpv2
pullusb 2023-01-16 17:58:34 +01:00
parent 80ec798144
commit 652c4632a9
1 changed files with 6 additions and 0 deletions

View File

@ -326,11 +326,17 @@ GP_OT_pick_closest_material,
) )
def register(): def register():
if bpy.app.background:
return
for cls in classes: for cls in classes:
bpy.utils.register_class(cls) bpy.utils.register_class(cls)
register_keymaps() register_keymaps()
def unregister(): def unregister():
if bpy.app.background:
return
unregister_keymaps() unregister_keymaps()
for cls in reversed(classes): for cls in reversed(classes):
bpy.utils.unregister_class(cls) bpy.utils.unregister_class(cls)