From 5aeb21342a82a24ceb239604e39c6507ea489f19 Mon Sep 17 00:00:00 2001 From: pullusb Date: Thu, 17 Apr 2025 16:42:25 +0200 Subject: [PATCH] Prevent loading prevent when trying to install in 4.3+ without raising error 3.3.4 - fixed: Error when trying to load addon in 4.3.0+ (prevent loading without error, print about incompatibility in console) --- CHANGELOG.md | 4 ++++ __init__.py | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1bffd2..65e4fc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +3.3.4 + +- fixed: Error when trying to load addon in 4.3.0+ (prevent loading without error, print about incompatibility in console) + 3.3.3 - added: list collections visibility conflict from search menu with dev extras (backported from gpv3) diff --git a/__init__.py b/__init__.py index cd242af..830ed46 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": (3, 3, 3), +"version": (3, 3, 4), "blender": (4, 0, 0), "location": "Sidebar (N menu) > Gpencil > Toolbox / Gpencil properties", "warning": "", @@ -812,6 +812,10 @@ addon_modules = ( ) def register(): + if bpy.app.version >= (4, 3, 0): + print(f"Skip GP toolbox load, version {'.'.join([str(x) for x in bl_info['version']])} incompatible with Blender 4.3+") + return + # Register property group first properties.register() for cls in classes: @@ -837,6 +841,10 @@ def register(): def unregister(): + if bpy.app.version >= (4, 3, 0): + # print(f'GP Toolbox version is not compatible with Blender 4.3+') + return + if 'remap_relative' in [hand.__name__ for hand in bpy.app.handlers.save_pre]: bpy.app.handlers.save_pre.remove(remap_relative)