]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/__init__.py
Remove the show_progress flag
[libs/gl.git] / blender / io_mspgl / __init__.py
index 8de91d25a7ddb91b795c9c53daed4387df9a41db..fb7a1a7a923fda0bda86eda9a3a6ce1cb790432c 100644 (file)
@@ -8,7 +8,7 @@ bl_info = {
 
 if "bpy" in locals():
        import imp
-       for sub in "animation", "armature", "datafile", "export", "export_animation", "export_armature", "export_camera", "export_material", "export_mesh", "export_object", "export_scene", "export_texture", "material", "mesh", "properties", "util":
+       for sub in "animation", "armature", "datafile", "export", "export_animation", "export_armature", "export_camera", "export_material", "export_mesh", "export_object", "export_scene", "export_texture", "material", "mesh", "properties", "scene", "util":
                if sub in locals():
                        imp.reload(locals()[sub])
 
@@ -17,8 +17,6 @@ import bpy
 from bpy_extras.io_utils import ExportHelper
 
 class ExportMspGLBase(ExportHelper):
-       show_progress: bpy.props.BoolProperty(name="Show progress", description="Display progress indicator while exporting", default=True)
-
        def set_extension(self, ext):
                ext_changed = (ext!=self.filename_ext)
                if ext_changed:
@@ -110,11 +108,20 @@ class ExportMspGLScene(bpy.types.Operator, ExportMspGLBase):
 
        filename_ext = ".scene"
 
-       selected_only: bpy.props.BoolProperty(name="Selected objects only", description="Only export the selected objects")
-       visible_collections: bpy.props.BoolProperty(name="Visible collections only", description="Only export objects in visible collections", default=True)
-       resource_collection: bpy.props.BoolProperty(name="Resource collection", description="Put resources to a single collection file", default=True)
+       selected_only: bpy.props.BoolProperty(name="Selected objects only", description="Only export the selected objects", default=False)
+       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)
 
+       def invoke(self, context, event):
+               self.filepath = context.scene.name+".scene"
+               return super().invoke(context, event)
+
+       def check(self, context):
+               ext_changed = self.set_extension(".mdc" if self.collection else ".scene")
+               super_result = super().check(context)
+               return ext_changed or super_result
+
        def create_exporter(self):
                from .export_scene import SceneExporter
                return SceneExporter()
@@ -122,9 +129,9 @@ class ExportMspGLScene(bpy.types.Operator, ExportMspGLBase):
        def draw(self, context):
                col = self.layout.column()
                col.prop(self, "selected_only")
-               col.prop(self, "visible_collections")
-               col.prop(self, "resource_collection")
-               if self.resource_collection:
+               col.prop(self, "visible_only")
+               col.prop(self, "collection")
+               if self.collection:
                        col.prop(self, "skip_existing")
 
 class AddUniform(bpy.types.Operator):