X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=blender%2Fio_mspgl%2F__init__.py;h=cba8178f66b06c2b36d775a5c37a125cf534d3cd;hp=79575f7df23b2c80761e24c09f499f68b7f45ee6;hb=7ae4af705535271ad84dbfe2b5a24bc9c546ae01;hpb=3b0cb993f410b05fc6309d41aa292f4e57c35519 diff --git a/blender/io_mspgl/__init__.py b/blender/io_mspgl/__init__.py index 79575f7d..cba8178f 100644 --- a/blender/io_mspgl/__init__.py +++ b/blender/io_mspgl/__init__.py @@ -132,6 +132,26 @@ class ExportMspGLScene(bpy.types.Operator, ExportHelper): if self.collection: col.prop(self, "skip_existing") +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') + + def invoke(self, context, event): + blend_filepath = context.blend_data.filepath + if blend_filepath: + self.directory = os.path.split(blend_filepath)[0] + context.window_manager.fileselect_add(self) + return {'RUNNING_MODAL'} + + def execute(self, context): + from .export import ProjectExporter + exporter = ProjectExporter() + exporter.export_to_directory(context, self.directory) + return {'FINISHED'} + class AddUniform(bpy.types.Operator): bl_idname = "material.add_uniform" bl_label = "Add Uniform" @@ -160,8 +180,9 @@ def menu_func_export(self, context): self.layout.operator(ExportMspGLData.bl_idname, text="Msp GL data") self.layout.operator(ExportMspGLAnimation.bl_idname, text="Msp GL animation") self.layout.operator(ExportMspGLScene.bl_idname, text="Msp GL scene") + self.layout.operator(ExportMspGLProject.bl_idname, text="Msp GL project") -classes = [ExportMspGLData, ExportMspGLAnimation, ExportMspGLScene, AddUniform, RemoveUniform] +classes = [ExportMspGLData, ExportMspGLAnimation, ExportMspGLScene, ExportMspGLProject, AddUniform, RemoveUniform] def register(): for c in classes: