Fixes
- Fixes issue with addon registration which just randomly broke at some point - Fixes issue where merge armatures decided to break due to me messing up with properties. - Fixed issue where you still had to select the mesh in the 3D Scene for viseme creation even though we have a UI selector now.
This commit is contained in:
@@ -30,8 +30,8 @@ class AvatarToolkit_OT_MergeArmature(bpy.types.Operator):
|
||||
wm.progress_begin(0, 100)
|
||||
|
||||
# Get both armatures
|
||||
base_armature_name: str = context.scene.merge_armature_into
|
||||
merge_armature_name: str = context.scene.merge_armature
|
||||
base_armature_name: str = context.scene.avatar_toolkit.merge_armature_into
|
||||
merge_armature_name: str = context.scene.avatar_toolkit.merge_armature
|
||||
base_armature: Optional[Object] = bpy.data.objects.get(base_armature_name)
|
||||
merge_armature: Optional[Object] = bpy.data.objects.get(merge_armature_name)
|
||||
|
||||
|
||||
+19
-3
@@ -126,15 +126,21 @@ class ATOOLKIT_OT_preview_visemes(Operator):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context: Context) -> bool:
|
||||
# Check if we're in object mode first
|
||||
# Check if we're in object mode
|
||||
if context.mode != 'OBJECT':
|
||||
return False
|
||||
|
||||
# Get mesh from UI selection
|
||||
props = context.scene.avatar_toolkit
|
||||
mesh_obj = bpy.data.objects.get(props.viseme_mesh)
|
||||
|
||||
# Validate armature and mesh
|
||||
armature = get_active_armature(context)
|
||||
if not armature:
|
||||
return False
|
||||
valid, _ = validate_armature(armature)
|
||||
return valid and context.active_object and context.active_object.type == 'MESH'
|
||||
return valid and mesh_obj and mesh_obj.type == 'MESH'
|
||||
|
||||
|
||||
def execute(self, context: Context) -> Set[str]:
|
||||
props = context.scene.avatar_toolkit
|
||||
@@ -179,11 +185,21 @@ class ATOOLKIT_OT_create_visemes(Operator):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context: Context) -> bool:
|
||||
# Check if we're in object mode
|
||||
if context.mode != 'OBJECT':
|
||||
return False
|
||||
|
||||
# Get mesh from UI selection
|
||||
props = context.scene.avatar_toolkit
|
||||
mesh_obj = bpy.data.objects.get(props.viseme_mesh)
|
||||
|
||||
# Validate armature and mesh
|
||||
armature = get_active_armature(context)
|
||||
if not armature:
|
||||
return False
|
||||
valid, _ = validate_armature(armature)
|
||||
return valid and context.active_object and context.active_object.type == 'MESH'
|
||||
return valid and mesh_obj and mesh_obj.type == 'MESH'
|
||||
|
||||
|
||||
def execute(self, context: Context) -> Set[str]:
|
||||
props = context.scene.avatar_toolkit
|
||||
|
||||
Reference in New Issue
Block a user