summaryrefslogtreecommitdiff
path: root/collada_superbmd_export.py
diff options
context:
space:
mode:
Diffstat (limited to 'collada_superbmd_export.py')
-rw-r--r--collada_superbmd_export.py11
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,