From b1efa77cdefe3a944676e4b7393329ad4cc4c279 Mon Sep 17 00:00:00 2001 From: Isaac Date: Fri, 20 Dec 2024 20:21:12 -0400 Subject: apply transform to all armature meshes on export --- collada_superbmd_export.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/collada_superbmd_export.py b/collada_superbmd_export.py index ba721d5..27d63c7 100644 --- a/collada_superbmd_export.py +++ b/collada_superbmd_export.py @@ -85,10 +85,16 @@ def write_bmd_bdl_collada(context, filepath, triangulate): armature = scene.objects.active blender_funcs.select_obj(scene, armature, False) - # apply the transformations + # apply the transformations to the armature armature.rotation_euler[0] = math.radians(-90) armature.scale = 100 * armature.scale - bpy.ops.object.transforms_to_deltas(mode = 'ALL') + bpy.ops.object.transform_apply(location = True, rotation = True, scale = True) + + # apply the transformations to the meshes inside the armature + for i in range(0, len(armature.children)): + blender_funcs.select_obj(scene, armature.children[i], False) + bpy.ops.object.transform_apply(location = True, rotation = True, scale = True) + blender_funcs.select_obj(scene, armature, False) # handle the object names so that they match the original model names armature.name = obj_name -- cgit v1.2.3-70-g09d2