diff options
author | Owl <isaclien9752@gmail.com> | 2025-08-27 23:54:31 -0400 |
---|---|---|
committer | Owl <isaclien9752@gmail.com> | 2025-08-27 23:54:31 -0400 |
commit | f4ff299e4e073b71495a3e2a385fa96d65fb6f80 (patch) | |
tree | 02ccd603b6f3907d108abd3d3d76ecdb1235b14a /collada_superbmd_export.py | |
parent | ea2eeb7d18869bb19773782289dca325c14776d0 (diff) | |
download | blenxy-f4ff299e4e073b71495a3e2a385fa96d65fb6f80.tar.gz blenxy-f4ff299e4e073b71495a3e2a385fa96d65fb6f80.zip |
rotations people, rotations...
Diffstat (limited to 'collada_superbmd_export.py')
-rw-r--r-- | collada_superbmd_export.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/collada_superbmd_export.py b/collada_superbmd_export.py index 1afae87..f66085c 100644 --- a/collada_superbmd_export.py +++ b/collada_superbmd_export.py @@ -91,7 +91,8 @@ def write_bmd_bdl_collada(context, filepath, triangulate): vertex_weight = 0 for group in vertex.groups: vertex_weight += group.weight - if (vertex_weight > 1.0): + # calling round because there seems to be floating point issues here + if (round(vertex_weight, 5) > 1): blender_funcs.disp_msg(("\"%s\": contains non normalized weight in vertices." % (mesh.name)) + " Unable to continue.") return {"FINISHED"} @@ -128,6 +129,14 @@ def write_bmd_bdl_collada(context, filepath, triangulate): armature.children[i].name = child_names[i] armature.children[i].data.name = child_names[i] + # delete all the rest_mat/bind_mat custom property matrices + # they seem to alter exported models in a weird way (I would expect it is a Assimp thing) + for bone in armature.data.bones: + if ("bind_mat" in bone): + bone.pop("bind_mat") + if ("rest_mat" in bone): + bone.pop("rest_mat") + # export the object bpy.ops.wm.collada_export(filepath = filepath, use_blender_profile = False, selected = True, include_children = True, |