diff options
author | Isaac <isaclien9752@gmail.com> | 2024-12-20 20:21:12 -0400 |
---|---|---|
committer | Isaac <isaclien9752@gmail.com> | 2024-12-20 20:21:12 -0400 |
commit | b1efa77cdefe3a944676e4b7393329ad4cc4c279 (patch) | |
tree | fd7a35df36c55b7a86616325a18b50eaee20a008 /collada_superbmd_export.py | |
parent | 94c26a2d7f366aaf6cbe823c1ecaeb603fa09976 (diff) | |
download | blenxy-b1efa77cdefe3a944676e4b7393329ad4cc4c279.tar.gz blenxy-b1efa77cdefe3a944676e4b7393329ad4cc4c279.zip |
apply transform to all armature meshes on export
Diffstat (limited to 'collada_superbmd_export.py')
-rw-r--r-- | collada_superbmd_export.py | 10 |
1 files 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 |