Skip to content

Commit

Permalink
feat: Make IO Voodoo Tracks compatible with the 4.2 extensions system
Browse files Browse the repository at this point in the history
  • Loading branch information
BlenderDefender committed Jun 23, 2024
1 parent 1d3b436 commit c7a8014
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
5 changes: 4 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
24 changes: 24 additions & 0 deletions blender_manifest.toml
Original file line number Diff line number Diff line change
@@ -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",
]
10 changes: 8 additions & 2 deletions prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit c7a8014

Please sign in to comment.