From dc612a18b60341b233fcac00f99405d98b61c01a Mon Sep 17 00:00:00 2001 From: Isaac Date: Fri, 8 Aug 2025 15:03:57 -0400 Subject: small stuff on collada / OBJ exporter for KCL / importer for NeoKCLCreate OBJs --- collada_superbmd_export.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'collada_superbmd_export.py') diff --git a/collada_superbmd_export.py b/collada_superbmd_export.py index 5d6f83f..ad1363b 100644 --- a/collada_superbmd_export.py +++ b/collada_superbmd_export.py @@ -26,6 +26,8 @@ def write_bmd_bdl_collada(context, filepath, triangulate): # get armature object armature = scene.objects.active print("\nArmature found: \"%s\"" % (armature.name)) + # change to object mode + bpy.ops.object.mode_set(mode='OBJECT') # check if the armature contains only mesh objects inside for obj in armature.children: @@ -45,11 +47,15 @@ def write_bmd_bdl_collada(context, filepath, triangulate): bpy.ops.object.modifier_add(type = 'ARMATURE') mesh.modifiers["Armature"].object = armature mesh.modifiers["Armature"].use_vertex_groups = True - else: # ensure bind is to a vertex group + else: # ensure bind is to a vertex group and that the bind is to the actual parent armature if (mesh.modifiers["Armature"].use_vertex_groups == False): blender_funcs.disp_msg("\"%s\": armature modifier wasn't binded to vertex groups" % (mesh.name)) mesh.modifiers["Armature"].use_vertex_groups = True + if (mesh.modifiers["Armature"].object != armature): + blender_funcs.disp_msg("\"%s\": armature modifier was binded to another armature object" + % (mesh.name)) + mesh.modifiers["Armature"].object = armature; # check if all the vertex groups in each mesh correspond to the name of a skeleton bone bone_name_list = [] @@ -140,7 +146,7 @@ class export_superbmd_collada(Operator, ExportHelper): filter_glob = StringProperty(default = "*.dae", options = {'HIDDEN'}, maxlen = 255) triangulate = BoolProperty(name = "Triangulate meshes", - description = "Triangulate meshes inside armatures", + description = "Triangulate meshes inside the armature", default = False) def execute(self, context): return write_bmd_bdl_collada(context, self.filepath, self.triangulate) -- cgit v1.2.3-70-g09d2