From 80ec798144327cf7314a79996d94bc7b4e532aa6 Mon Sep 17 00:00:00 2001 From: pullusb Date: Mon, 16 Jan 2023 17:56:51 +0100 Subject: [PATCH] prevent keymap register in background mode 2.1.6 - Fixed: Prevent some keymaps to register when blender is launched in background mode --- CHANGELOG.md | 4 ++++ OP_layer_manager.py | 4 ++++ __init__.py | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index afadc7f..7481855 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog +2.1.6 + +- Fixed: Prevent some keymaps to register when blender is launched in background mode + 2.1.5 - fixed: false positive with checkfile in modifier layer target diff --git a/OP_layer_manager.py b/OP_layer_manager.py index bce7ff1..d3169d1 100644 --- a/OP_layer_manager.py +++ b/OP_layer_manager.py @@ -759,6 +759,8 @@ class GPTB_OT_add_gp_layer(Operator): addon_keymaps = [] def register_keymaps(): + if bpy.app.background: + return addon = bpy.context.window_manager.keyconfigs.addon ##---# Insert Layers @@ -789,6 +791,8 @@ def register_keymaps(): def unregister_keymaps(): + if bpy.app.background: + return for km, kmi in addon_keymaps: km.keymap_items.remove(kmi) addon_keymaps.clear() diff --git a/__init__.py b/__init__.py index a68bb6e..513a62f 100755 --- a/__init__.py +++ b/__init__.py @@ -4,7 +4,7 @@ bl_info = { "name": "GP toolbox", "description": "Tool set for Grease Pencil in animation production", "author": "Samuel Bernou, Christophe Seux", -"version": (2, 1, 5), +"version": (2, 1, 6), "blender": (3, 0, 0), "location": "Sidebar (N menu) > Gpencil > Toolbox / Gpencil properties", "warning": "",