From f4ff299e4e073b71495a3e2a385fa96d65fb6f80 Mon Sep 17 00:00:00 2001 From: Owl Date: Wed, 27 Aug 2025 23:54:31 -0400 Subject: rotations people, rotations... --- collada_superbmd_export.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'collada_superbmd_export.py') 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, -- cgit v1.2.3-70-g09d2