Skip to content

Commit

Permalink
new animation retargeting mapping automation
Browse files Browse the repository at this point in the history
  • Loading branch information
wikid24 committed Nov 29, 2023
1 parent 8f3bdd7 commit e963cc2
Show file tree
Hide file tree
Showing 9 changed files with 944 additions and 418 deletions.
6 changes: 5 additions & 1 deletion ffxiv_mmd_tools_helper/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bl_info = {
"name": "FFXIV MMD Tools Helper",
"author": "wikid24",
"version": (0, 871),
"version": (0, 872),
"blender": (2, 80, 0),
"location": "View3D > Sidebar > FFXIV MMD Tools Helper",
"description": "Fork of MMDToolsHelper for FFXIV Models & updated Blender to be compatible with 2.8+",
Expand Down Expand Up @@ -49,6 +49,7 @@ def register_wrap(cls):
importlib.reload(bone_tools)
importlib.reload(bone_rigify)
importlib.reload(bone_mektools)
importlib.reload(bone_retargeting_addon)
importlib.reload(bones_renamer)
importlib.reload(convert_to_blender_camera)
importlib.reload(display_panel_groups)
Expand All @@ -68,6 +69,7 @@ def register_wrap(cls):
importlib.reload(shaders)
importlib.reload(tex_converter)
importlib.reload(panels)
importlib.reload(panels_retargeting_addon)

else:
import bpy
Expand All @@ -88,6 +90,7 @@ def register_wrap(cls):
from . import bone_rigify
from . import bone_mektools
from . import bones_renamer
from . import bone_retargeting_addon
from . import convert_to_blender_camera
from . import display_panel_groups
from . import facepaint
Expand All @@ -106,6 +109,7 @@ def register_wrap(cls):
from . import shaders
from . import tex_converter
from . import panels
from . import panels_retargeting_addon

if bpy.app.version < (2, 80, 0):
bl_info['blender'] = (2, 70, 0)
Expand Down
48 changes: 26 additions & 22 deletions ffxiv_mmd_tools_helper/bone_mektools.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,31 @@
print(f"The addon 'mek_tools' is not installed or is not enabled. Please install and enable it.")


def is_addon_installed():
addon_name = 'mek_tools'
addon_required_version = (0,3,5)
addon_module = None

try:
addon_module = [m for m in addon_utils.modules() if m.__name__ == addon_name][0] # get module
except:
return False
#raise Exception(f"The addon {addon_name} is not installed or is not enabled. Please install and enable it.")

if addon_module:
installed_version = addon_module.bl_info.get('version',(-1,-1,-1))

# Check if the addon is enabled
if addon_name not in bpy.context.preferences.addons.keys():
return False
#raise Exception(f"The addon '{addon_name}' is not installed or is not enabled. Please install and enable it.")
elif installed_version < addon_required_version:
return False
#raise Exception(f"Addon '{addon_name}' version is {installed_version} please install {addon_required_version} or higher.")
else:
return True
#print(f"The addon '{addon_name}' is installed and enabled.")


def auto_create_mektools_armature_from_race(target_armature):

Expand Down Expand Up @@ -174,9 +199,6 @@ def apply_copy_location_for_mektools_armature_from_meshes(target_armature):






@register_wrap
class ApplyMekToolsRig(bpy.types.Operator):
"""Adds a MekTools rig based on the current FFXIV Race"""
Expand All @@ -200,25 +222,7 @@ def poll(cls, context):

def execute(self, context):

addon_name = 'mek_tools'
addon_required_version = '0.35'
addon_module = None
try:
addon_module = [m for m in addon_utils.modules() if m.__name__ == addon_name][0] # get module
except:
raise Exception(f"The addon 'mek_tools' is not installed or is not enabled. Please install and enable it.")

if addon_module:
installed_version = addon_module.bl_info.get('version',(-1,-1,-1))
installed_version = float(str(installed_version[0])+'.'+str(installed_version[1])+str(installed_version[2]))

# Check if the addon is enabled
if addon_name not in bpy.context.preferences.addons.keys():
raise Exception(f"The addon '{addon_name}' is not installed or is not enabled. Please install and enable it.")
elif installed_version < float(addon_required_version):
raise Exception(f"Addon '{addon_name}' version is {installed_version} please install {addon_required_version} or higher.")
else:
#print(f"The addon '{addon_name}' is installed and enabled.")
if is_addon_installed():

active_armature = None

Expand Down
Loading

0 comments on commit e963cc2

Please sign in to comment.