summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac <isaclien9752@gmail.com>2024-12-20 20:21:12 -0400
committerIsaac <isaclien9752@gmail.com>2024-12-20 20:21:12 -0400
commitb1efa77cdefe3a944676e4b7393329ad4cc4c279 (patch)
treefd7a35df36c55b7a86616325a18b50eaee20a008
parent94c26a2d7f366aaf6cbe823c1ecaeb603fa09976 (diff)
downloadblenxy-b1efa77cdefe3a944676e4b7393329ad4cc4c279.tar.gz
blenxy-b1efa77cdefe3a944676e4b7393329ad4cc4c279.zip
apply transform to all armature meshes on export
-rw-r--r--collada_superbmd_export.py10
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