From 652c4632a91fec7a735e1b7a7c447a284056c224 Mon Sep 17 00:00:00 2001 From: pullusb Date: Mon, 16 Jan 2023 17:58:34 +0100 Subject: [PATCH] prevent picker register on background mode --- OP_material_picker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OP_material_picker.py b/OP_material_picker.py index 390e34b..cc88758 100644 --- a/OP_material_picker.py +++ b/OP_material_picker.py @@ -326,11 +326,17 @@ GP_OT_pick_closest_material, ) def register(): + if bpy.app.background: + return + for cls in classes: bpy.utils.register_class(cls) register_keymaps() def unregister(): + if bpy.app.background: + return + unregister_keymaps() for cls in reversed(classes): bpy.utils.unregister_class(cls) \ No newline at end of file