Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-09-01 06:25:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-01 06:25:49 +0400
commit5036a9d20c2098cf779ae832855761ad038bf27f (patch)
treea932affea745f76f597cdbd7c6169c7f15ef7d19 /release/scripts/io/export_mdd.py
parentd67eedcef9a4fb34f29513bc0dd21b97ea9567be (diff)
use mix-in classes for import export operators, these define the filepath property and invoke function at the moment.
Diffstat (limited to 'release/scripts/io/export_mdd.py')
-rw-r--r--release/scripts/io/export_mdd.py17
1 files changed, 5 insertions, 12 deletions
diff --git a/release/scripts/io/export_mdd.py b/release/scripts/io/export_mdd.py
index b2eda13fc8f..7630eec7844 100644
--- a/release/scripts/io/export_mdd.py
+++ b/release/scripts/io/export_mdd.py
@@ -143,12 +143,15 @@ def write(filename, sce, ob, PREF_STARTFRAME, PREF_ENDFRAME, PREF_FPS):
sce.set_frame(orig_frame)
from bpy.props import *
+from io_utils import ExportHelper
-class ExportMDD(bpy.types.Operator):
+class ExportMDD(bpy.types.Operator, ExportHelper):
'''Animated mesh to MDD vertex keyframe file'''
bl_idname = "export.mdd"
bl_label = "Export MDD"
+
+ filename_ext = ".mdd"
# get first scene to get min and max properties for frames, fps
@@ -159,8 +162,6 @@ class ExportMDD(bpy.types.Operator):
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
- filepath = StringProperty(name="File Path", description="Filepath used for exporting the MDD file", maxlen=1024)
- check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
fps = IntProperty(name="Frames Per Second", description="Number of frames/second", min=minfps, max=maxfps, default=25)
frame_start = IntProperty(name="Start Frame", description="Start frame for baking", min=minframe, max=maxframe, default=1)
frame_end = IntProperty(name="End Frame", description="End frame for baking", min=minframe, max=maxframe, default=250)
@@ -172,7 +173,7 @@ class ExportMDD(bpy.types.Operator):
def execute(self, context):
filepath = self.properties.filepath
- filepath = bpy.path.ensure_ext(filepath, ".mdd")
+ filepath = bpy.path.ensure_ext(filepath, self.filename_ext)
write(filepath,
context.scene,
@@ -184,14 +185,6 @@ class ExportMDD(bpy.types.Operator):
return {'FINISHED'}
- def invoke(self, context, event):
- import os
- if not self.properties.is_property_set("filepath"):
- self.properties.filepath = os.path.splitext(bpy.data.filepath)[0] + ".mdd"
-
- context.manager.add_fileselect(self)
- return {'RUNNING_MODAL'}
-
def menu_func(self, context):
self.layout.operator(ExportMDD.bl_idname, text="Lightwave Point Cache (.mdd)")