if "bpy" in locals():
import imp
- for sub in "armature", "export_armature", "export_mesh", "export_object", "mesh", "outfile", "util":
+ for sub in "armature", "export_armature", "export_mesh", "export_object", "mesh", "outfile", "properties", "util":
if sub in locals():
imp.reload(locals()[sub])
self.layout.operator(ExportMspGLObject.bl_idname, text="Msp GL object")
self.layout.operator(ExportMspGLArmature.bl_idname, text="Msp GL armature")
+from .properties import MspGLProperties
+
def register():
bpy.utils.register_module(__name__)
bpy.types.INFO_MT_file_export.append(menu_func_export)
+ from .properties import register_properties
+ register_properties();
+
def unregister():
bpy.utils.unregister_module(__name__)
def export(self, context, out_file):
if self.compound:
objs = context.selected_objects
+ check = objs
+ while check:
+ children = []
+ for o in check:
+ for c in o.children:
+ if c.compound:
+ children.append(c)
+ objs += children
+ check = children
else:
objs = [context.active_object]
--- /dev/null
+import bpy
+
+class MspGLProperties(bpy.types.Panel):
+ bl_idname = "OBJECT_PT_mspgl_properties"
+ bl_label = "MspGL properties"
+ bl_space_type = "PROPERTIES"
+ bl_region_type = "WINDOW"
+ bl_context = "object"
+
+ def draw(self, context):
+ obj = context.active_object
+
+ self.layout.prop(obj, "compound");
+
+def register_properties():
+ bpy.types.Object.compound = bpy.props.BoolProperty(name="Compound with parent", description="Join this object to its parent when exporting")