X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=blender%2Fio_mspgl%2F__init__.py;fp=blender%2Fio_mspgl%2F__init__.py;h=02afb148614ecd44fc3408166357a8eea8534c12;hb=859f8b99ee65bb52c7a44194420a156ef5be3413;hp=13375e2426795d4995e1505987210dd3c4f75476;hpb=2108712bcde8b5c4573ca4d602d5f8948b810d72;p=libs%2Fgl.git diff --git a/blender/io_mspgl/__init__.py b/blender/io_mspgl/__init__.py index 13375e24..02afb148 100644 --- a/blender/io_mspgl/__init__.py +++ b/blender/io_mspgl/__init__.py @@ -110,11 +110,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") + 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) - resource_collection: bpy.props.BoolProperty(name="Resource collection", description="Put resources to a single collection file", 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() @@ -123,8 +132,8 @@ class ExportMspGLScene(bpy.types.Operator, ExportMspGLBase): col = self.layout.column() col.prop(self, "selected_only") col.prop(self, "visible_only") - col.prop(self, "resource_collection") - if self.resource_collection: + col.prop(self, "collection") + if self.collection: col.prop(self, "skip_existing") class AddUniform(bpy.types.Operator):