X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=blender%2Fio_mspgl%2F__init__.py;h=4c5fa8c22ce735f4322396ed01e120ee0827e14e;hp=d555ab4b30d54e59f48f5453c2612dfef73ec2ba;hb=8cea7c616aa74f2bb23d41ece5e4ef1f59f9e4b4;hpb=f2cab83d5704f3f4a91f551f402187637e5063d2 diff --git a/blender/io_mspgl/__init__.py b/blender/io_mspgl/__init__.py index d555ab4b..4c5fa8c2 100644 --- a/blender/io_mspgl/__init__.py +++ b/blender/io_mspgl/__init__.py @@ -96,17 +96,45 @@ class ExportMspGLAnimation(bpy.types.Operator, ExportMspGLBase): filename_ext = ".anim" + 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) + + def check(self, context): + result = False + + ext = ".mdc" if self.export_all and self.collection else ".anim" + ext_changed = (ext!=self.filename_ext) + if ext_changed: + if self.filepath.endswith(self.filename_ext): + self.filepath = self.filepath[:-len(self.filename_ext)] + self.filename_ext = ext + + super_result = super().check(context) + + return ext_changed or super_result + def create_exporter(self): from .export_animation import AnimationExporter return AnimationExporter() + def draw(self, context): + col = self.layout.column() + col.prop(self, "export_all") + if self.export_all: + col.prop(self, "collection") + col.prop(self, "looping_threshold") + class ExportMspGLScene(bpy.types.Operator, ExportMspGLBase): bl_idname = "export_scene.mspgl_scene" bl_label = "Export Msp GL scene" filename_ext = ".scene" + selected_only = bpy.props.BoolProperty(name="Selected objects only", description="Only export the selected objects") + active_layers = bpy.props.BoolProperty(name="Active layers only", description="Only export objects on the active layers", default=True) resource_collection = bpy.props.BoolProperty(name="Resource collection", description="Put resources to a single collection file", default=True) + skip_existing = bpy.props.BoolProperty(name="Skip existing files", description="Skip resources that already exist as files", default=True) def create_exporter(self): from .export_scene import SceneExporter @@ -114,7 +142,11 @@ class ExportMspGLScene(bpy.types.Operator, ExportMspGLBase): def draw(self, context): col = self.layout.column() + col.prop(self, "selected_only") + col.prop(self, "active_layers") col.prop(self, "resource_collection") + if self.resource_collection: + col.prop(self, "skip_existing") class ExportMspGLCamera(bpy.types.Operator, ExportMspGLBase): bl_idname = "export.mspgl_camera"