summaryrefslogtreecommitdiff
path: root/collada_superbmd_export.py
diff options
context:
space:
mode:
authorIsaac <isaclien9752@gmail.com>2025-08-08 15:03:57 -0400
committerIsaac <isaclien9752@gmail.com>2025-08-08 15:03:57 -0400
commitdc612a18b60341b233fcac00f99405d98b61c01a (patch)
tree0a914f90bb69ed665287ca8701d000aa8c470da8 /collada_superbmd_export.py
parent46fb63ea8d3c33d5cb5914a05998c8f6ff74abea (diff)
downloadblenxy-dc612a18b60341b233fcac00f99405d98b61c01a.tar.gz
blenxy-dc612a18b60341b233fcac00f99405d98b61c01a.zip
small stuff on collada / OBJ exporter for KCL / importer for NeoKCLCreate OBJs
Diffstat (limited to 'collada_superbmd_export.py')
-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 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)