filepath: bpy.props.StringProperty(name="File path", description="File path for exporting the data", subtype='FILE_PATH')
collection: bpy.props.BoolProperty(name="As a collection", description="Export all data as a single collection file", default=False)
shared_resources: bpy.props.BoolProperty(name="Shared resources", description="Use global names for resource files to enable sharing", default=True)
+ debug_mode: bpy.props.BoolProperty(name="Debug mode", description="Enable debugging output to console")
@classmethod
def poll(cls, context):
return {'RUNNING_MODAL'}
def execute(self, context):
+ from .context import ExportContext
from .export import DataExporter
+
+ ex_ctx = ExportContext(context, verbose=self.debug_mode)
exporter = DataExporter()
- exporter.export_to_file(context, self.filepath,
+ ex_ctx.export(exporter.export_to_file, self.filepath,
collection=self.collection,
shared_resources=self.shared_resources)
return {'FINISHED'}
col.prop(self, "collection")
col.prop(self, "shared_resources")
+ self.layout.separator()
+
+ col = self.layout.column()
+ col.prop(self, "debug_mode")
+
class ExportMspGLAnimation(bpy.types.Operator, ExportHelper):
bl_idname = "export.mspgl_animation"
bl_label = "Export Msp GL animation"
export_all: bpy.props.BoolProperty(name="Export all animations", description="Export all animations present on the selected objects' NLA tracks")
collection: bpy.props.BoolProperty(name="As a collection", description="Export the animations as a single collection file", default=True)
looping_threshold: bpy.props.FloatProperty(name="Looping threshold", description="Tolerance for curve beginning and end values for looping", min=0.0, soft_max=1.0, precision=4, default=0.001)
+ debug_mode: bpy.props.BoolProperty(name="Debug mode", description="Enable debugging output to console")
def check(self, context):
ext_changed = self.set_extension(".mdc" if self.export_all and self.collection else ".anim")
return ext_changed or super_result
def execute(self, context):
+ from .context import ExportContext
from .export_animation import AnimationExporter
+
+ ex_ctx = ExportContext(context, verbose=self.debug_mode)
exporter = AnimationExporter()
- exporter.export_to_file(context, self.filepath,
+ ex_ctx.export(exporter.export_to_file, self.filepath,
export_all=self.export_all,
collection=self.collection,
looping_threshold=looping_threshold)
col.prop(self, "collection")
col.prop(self, "looping_threshold")
+ self.layout.separator()
+
+ col = self.layout.column()
+ col.prop(self, "debug_mode")
+
class ExportMspGLScene(bpy.types.Operator, ExportHelper):
bl_idname = "export_scene.mspgl_scene"
bl_label = "Export Msp GL scene"
visible_only: bpy.props.BoolProperty(name="Visible only", description="Only export objects in visible collections", default=True)
collection: bpy.props.BoolProperty(name="As a collection", description="Export the scene and all resources as a single collection file", default=False)
skip_existing: bpy.props.BoolProperty(name="Skip existing files", description="Skip resources that already exist as files", default=True)
+ debug_mode: bpy.props.BoolProperty(name="Debug mode", description="Enable debugging output to console")
def invoke(self, context, event):
self.filepath = context.scene.name+".scene"
return ext_changed or super_result
def execute(self, context):
+ from .context import ExportContext
from .export_scene import SceneExporter
+
+ ex_ctx = ExportContext(context, verbose=self.debug_mode)
exporter = SceneExporter()
- exporter.export_to_file(context, self.filepath,
+ ex_ctx.export(exporter.export_to_file, self.filepath,
selected_only=self.selected_only,
visible_only=self.visible_only,
collection=self.collection,
if self.collection:
col.prop(self, "skip_existing")
+ self.layout.separator()
+
+ col = self.layout.column()
+ col.prop(self, "debug_mode")
+
class ExportMspGLProject(bpy.types.Operator):
bl_idname = "export.mspgl_project"
bl_label = "Export Msp GL project"
bl_description = "Export the entire project in Msp GL format"
directory: bpy.props.StringProperty(name="Directory", description="Directory for exporting the data", subtype='FILE_PATH')
+ debug_mode: bpy.props.BoolProperty(name="Debug mode", description="Enable debugging output to console")
def invoke(self, context, event):
blend_filepath = context.blend_data.filepath
return {'RUNNING_MODAL'}
def execute(self, context):
+ from .context import ExportContext
from .export import ProjectExporter
+
+ ex_ctx = ExportContext(context, verbose=self.debug_mode)
exporter = ProjectExporter()
- exporter.export_to_directory(context, self.directory)
+ ex_ctx.export(exporter.export_to_directory, self.directory)
return {'FINISHED'}
+ def draw(self, context):
+ col = self.layout.column()
+ col.prop(self, "debug_mode")
+
class AddRenderMethod(bpy.types.Operator):
bl_idname = "material.add_render_method"
bl_label = "Add Render Method"