summaryrefslogtreecommitdiff
path: root/obj_kcl_export.py
diff options
context:
space:
mode:
authorOwl <isaclien9752@gmail.com>2025-08-21 20:07:13 -0400
committerOwl <isaclien9752@gmail.com>2025-08-21 20:07:13 -0400
commitef4d0e08b2d312bcf3034aa3ae48436f5d8b56a5 (patch)
tree88c06847d16e29acdd743066b0781fc17ebde3eb /obj_kcl_export.py
parent5fb5906f45a20652b8cbadc5657df9ca506f11db (diff)
downloadblenxy-ef4d0e08b2d312bcf3034aa3ae48436f5d8b56a5.tar.gz
blenxy-ef4d0e08b2d312bcf3034aa3ae48436f5d8b56a5.zip
all the stuff
Diffstat (limited to 'obj_kcl_export.py')
-rw-r--r--obj_kcl_export.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/obj_kcl_export.py b/obj_kcl_export.py
index b106869..56b6d18 100644
--- a/obj_kcl_export.py
+++ b/obj_kcl_export.py
@@ -12,29 +12,27 @@ def write_kcl_obj(context, filepath):
scene = bpy.context.scene
# if nothing is selected end the exporter
- if (scene.objects.active == None or scene.objects.active.type != 'ARMATURE'):
+ if (scene.objects.active == None or scene.objects.active.type != "ARMATURE"):
if (scene.objects.active == None):
blender_funcs.disp_msg("No Armature selected. Select one and try again.")
else:
- blender_funcs.disp_msg("No Armature selected. Currently selecting: \"%s\""
- % (scene.objects.active.name))
- return {'FINISHED'}
+ blender_funcs.disp_msg("No Armature selected. Currently selecting: \"%s\"" % (scene.objects.active.name))
+ return {"FINISHED"}
# get armature object
armature = scene.objects.active
print("\nArmature found: \"%s\"" % (armature.name))
- # change to object mode
- bpy.ops.object.mode_set(mode='OBJECT')
+ # select it well
+ blender_funcs.select_obj(armature, False, "OBJECT")
# check if the armature contains only mesh objects inside
for obj in armature.children:
- if (obj.type != 'MESH'):
- blender_funcs.disp_msg("\"%s\": contains non-mesh object (%s)."
- % (armature.name, obj.name))
- return {'FINISHED'}
+ if (obj.type != "MESH"):
+ blender_funcs.disp_msg("\"%s\": contains non-mesh object (%s)." % (armature.name, obj.name))
+ return {"FINISHED"}
# select all the meshes inside the armature
- blender_funcs.select_obj(scene, armature, True)
+ blender_funcs.select_obj(armature, True, "OBJECT")
# export the object
bpy.ops.export_scene.obj(filepath = filepath, axis_up = "Y", axis_forward = "-Z",
@@ -42,9 +40,9 @@ def write_kcl_obj(context, filepath):
use_materials = True, use_normals = True)
# done!
- blender_funcs.select_obj(scene, armature, False)
+ blender_funcs.select_obj(armature, False, "OBJECT")
blender_funcs.disp_msg("Meshes from \"%s\" exported!" % (armature.name))
- return {'FINISHED'}
+ return {"FINISHED"}
# Stuff down is for the menu appending
# of the exporter to work plus some setting stuff