Join Meshes Fixes

This commit is contained in:
Yusarina
2024-11-27 02:56:12 +00:00
parent 6484adedaa
commit 0ac4b4a144
2 changed files with 54 additions and 6 deletions
+5
View File
@@ -104,10 +104,13 @@ class AvatarToolKit_OT_JoinAllMeshes(Operator):
raise ValueError(t("Optimization.no_armature_selected"))
armature = get_selected_armature(context)
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.select_all(action='DESELECT')
meshes: List[Object] = get_all_meshes(context)
if not meshes:
raise ValueError(t("Optimization.no_meshes_found"))
@@ -133,6 +136,7 @@ class AvatarToolKit_OT_JoinAllMeshes(Operator):
raise RuntimeError(f"{t('Optimization.transform_apply_failed')}: {str(e)}")
update_progress(self, context, t("Optimization.fixing_uv_coordinates"))
bpy.ops.object.mode_set(mode='OBJECT')
fix_uv_coordinates(context)
update_progress(self, context, t("Optimization.finalizing"))
@@ -145,6 +149,7 @@ class AvatarToolKit_OT_JoinAllMeshes(Operator):
context.view_layer.objects.active = armature
finish_progress(context)
@register_wrap
class AvatarToolKit_OT_JoinSelectedMeshes(Operator):
bl_idname = "avatar_toolkit.join_selected_meshes"