diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-08-09 15:32:55 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-08-09 15:32:55 +0400 |
commit | dd75ec490761640571a0d8e53a0d439091f2736f (patch) | |
tree | 25b3966862febbf3ee8c81ed45f7045c99f84016 /release/scripts/io/export_mdd.py | |
parent | 02b0967bd11dd6fd2454b37182d9f94ea451b603 (diff) | |
parent | c026b8066ddc1c42144d2e5132384ea7c1211050 (diff) |
Merged changes in the trunk up to revision 31190.
Diffstat (limited to 'release/scripts/io/export_mdd.py')
-rw-r--r-- | release/scripts/io/export_mdd.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/release/scripts/io/export_mdd.py b/release/scripts/io/export_mdd.py index d2e53070910..2d45e18ef77 100644 --- a/release/scripts/io/export_mdd.py +++ b/release/scripts/io/export_mdd.py @@ -165,15 +165,23 @@ class ExportMDD(bpy.types.Operator): 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) - def poll(self, context): + @classmethod + def poll(cls, context): ob = context.active_object return (ob and ob.type == 'MESH') def execute(self, context): - if not self.properties.filepath: - raise Exception("filename not set") - write(self.properties.filepath, context.scene, context.active_object, - self.properties.frame_start, self.properties.frame_end, self.properties.fps) + filepath = self.properties.filepath + filepath = bpy.path.ensure_ext(filepath, ".mdd") + + write(filepath, + context.scene, + context.active_object, + self.properties.frame_start, + self.properties.frame_end, + self.properties.fps, + ) + return {'FINISHED'} def invoke(self, context, event): @@ -189,12 +197,10 @@ def menu_func(self, context): def register(): - bpy.types.register(ExportMDD) bpy.types.INFO_MT_file_export.append(menu_func) def unregister(): - bpy.types.unregister(ExportMDD) bpy.types.INFO_MT_file_export.remove(menu_func) if __name__ == "__main__": |