Merge branch 'Alpha-2' into Amrature-Validation-P2

This commit is contained in:
Yusarina
2025-03-24 02:14:41 +00:00
committed by GitHub
3 changed files with 16 additions and 5 deletions
+13 -2
View File
@@ -49,12 +49,16 @@ def update_shape_intensity(self: PropertyGroup, context: Context) -> None:
if self.viseme_preview_mode: if self.viseme_preview_mode:
VisemePreview.update_preview(context) VisemePreview.update_preview(context)
def highlight_problem_bones(self: PropertyGroup, context: Context) -> None: def highlight_problem_bones(self: PropertyGroup, context: Context) -> None:
"""Updates problem bone highlighting state and saves preference""" """Updates problem bone highlighting state and saves preference"""
logger.info(f"Updating problem bone highlighting to: {self.highlight_problem_bones}") logger.info(f"Updating problem bone highlighting to: {self.highlight_problem_bones}")
save_preference("highlight_problem_bones", self.highlight_problem_bones) save_preference("highlight_problem_bones", self.highlight_problem_bones)
def get_mesh_objects(self, context):
meshes = [(obj.name, obj.name, "") for obj in bpy.data.objects if obj.type == 'MESH']
if not meshes:
return [('NONE', t("Visemes.no_meshes"), '')]
return meshes
class AvatarToolkitSceneProperties(PropertyGroup): class AvatarToolkitSceneProperties(PropertyGroup):
"""Property group containing Avatar Toolkit scene-level settings and properties""" """Property group containing Avatar Toolkit scene-level settings and properties"""
@@ -142,6 +146,12 @@ class AvatarToolkitSceneProperties(PropertyGroup):
items=get_texture_node_list items=get_texture_node_list
) )
list_only_mode: BoolProperty(
name=t("Tools.list_only_mode"),
description=t("Tools.list_only_mode_desc"),
default=False
)
Material.include_in_atlas = BoolProperty( Material.include_in_atlas = BoolProperty(
name=t("TextureAtlas.include_in_atlas"), name=t("TextureAtlas.include_in_atlas"),
description=t("TextureAtlas.include_in_atlas_desc"), description=t("TextureAtlas.include_in_atlas_desc"),
@@ -283,9 +293,10 @@ class AvatarToolkitSceneProperties(PropertyGroup):
description=t("Visemes.mouth_ch_desc") description=t("Visemes.mouth_ch_desc")
) )
viseme_mesh: StringProperty( viseme_mesh: EnumProperty(
name=t("Visemes.mesh_select"), name=t("Visemes.mesh_select"),
description=t("Visemes.mesh_select_desc"), description=t("Visemes.mesh_select_desc"),
items=get_mesh_objects
) )
shape_intensity: FloatProperty( shape_intensity: FloatProperty(
+1 -1
View File
@@ -51,7 +51,7 @@ class AvatarToolkit_OT_ConvertResonite(Operator):
armature = get_active_armature(context) armature = get_active_armature(context)
if not armature: if not armature:
return False return False
is_valid, _ = validate_armature(armature) is_valid, _, _ = validate_armature(armature)
return is_valid return is_valid
def execute(self, context: Context) -> Set[str]: def execute(self, context: Context) -> Set[str]:
+2 -2
View File
@@ -28,13 +28,13 @@ class AvatarToolKit_PT_VisemesPanel(Panel):
armature = get_active_armature(context) armature = get_active_armature(context)
if armature: if armature:
col.prop_search(props, "viseme_mesh", bpy.data, "objects", text="") col.prop(props, "viseme_mesh", text="")
else: else:
col.label(text=t("Visemes.no_armature"), icon='ERROR') col.label(text=t("Visemes.no_armature"), icon='ERROR')
# Get selected mesh # Get selected mesh
mesh_obj = bpy.data.objects.get(props.viseme_mesh) mesh_obj = bpy.data.objects.get(props.viseme_mesh)
if not mesh_obj or not mesh_obj.data.shape_keys: if not mesh_obj or not mesh_obj.data or not mesh_obj.data.shape_keys:
layout.label(text=t("Visemes.no_shapekeys")) layout.label(text=t("Visemes.no_shapekeys"))
return return