diff --git a/__init__.py b/__init__.py index f36faeb..bcdea9c 100644 --- a/__init__.py +++ b/__init__.py @@ -75,7 +75,10 @@ def register(): decoding) setup_addons_data(data[1]) - prefs.register(bl_info) + if bpy.app.version < (4, 2): + prefs.register_legacy(bl_info) + else: + prefs.register() operators.register() bpy.types.TOPBAR_MT_file_import.append(menu_func) diff --git a/blender_manifest.toml b/blender_manifest.toml new file mode 100644 index 0000000..28f61bd --- /dev/null +++ b/blender_manifest.toml @@ -0,0 +1,24 @@ +schema_version = "1.0.0" + +id = "blenderdefender_io_voodoo_tracks" +name = "Import Voodoo Camera Tracks" +version = "1.0.7" +tagline = "Easily import old Voodoo Camera Tracker Scripts" +# tagline = "Import Voodoo Camera Tracker Scripts (for Blender 2.5) to Blender 4.2+ the easy way" +maintainer = "Blender Defender" +website = "https://github.com/BlenderDefender/io_voodoo_tracks/issues" + +type = "add-on" +blender_version_min = "4.2.0" +license = ["SPDX:GPL-3.0-or-later"] + +[build] +paths_exclude_pattern = [ + "/.git/", + "/.github/", + "/.vscode/", + ".gitignore", + "*_updater/", + "__pycache__/", + "Screenshots", +] diff --git a/prefs.py b/prefs.py index 894d9f6..b021414 100644 --- a/prefs.py +++ b/prefs.py @@ -106,7 +106,8 @@ def draw(self, context: 'Context'): text="Upgrade to donation version.") # could also pass in col as third arg - addon_updater_ops.update_settings_ui(self, context) + if bpy.app.version < (4, 2): + addon_updater_ops.update_settings_ui(self, context) # Alternate draw function, which is more condensed and can be # placed within an existing draw function. Only contains: @@ -125,7 +126,7 @@ def draw(self, context: 'Context'): ) -def register(bl_info): +def register_legacy(bl_info): # addon updater code and configurations # in case of broken version, try to register the updater first # so that users can revert back to a working version @@ -138,6 +139,11 @@ def register(bl_info): bpy.utils.register_class(cls) +def register(): + for cls in classes: + bpy.utils.register_class(cls) + + def unregister(): # addon updater unregister addon_updater_ops.unregister()