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-08-13 10:45:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-13 10:45:33 +0400
commitf662c0de0521d01ff546d46d5e9fb8a0f64c1c95 (patch)
tree647f2422c42edabadd8ab5dc0a7dcc766f8f4908 /release/scripts/io/export_3ds.py
parentbf52b68dcd1864fd35309f9aae19f146da5b774e (diff)
exporters now set the filepath in the invoke() method rather then the menu drawing function.
Diffstat (limited to 'release/scripts/io/export_3ds.py')
-rw-r--r--release/scripts/io/export_3ds.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/release/scripts/io/export_3ds.py b/release/scripts/io/export_3ds.py
index 2a8b43c4e84..83c9defd6ab 100644
--- a/release/scripts/io/export_3ds.py
+++ b/release/scripts/io/export_3ds.py
@@ -1114,13 +1114,13 @@ class Export3DS(bpy.types.Operator):
bl_idname = "export.autodesk_3ds"
bl_label = 'Export 3DS'
- # 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 3DS file", maxlen= 1024, default= "")
check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
+ @classmethod
+ def poll(cls, context): # Poll isnt working yet
+ return context.active_object != None
+
def execute(self, context):
filepath = self.properties.filepath
filepath = bpy.path.ensure_ext(filepath, ".3ds")
@@ -1129,23 +1129,23 @@ class Export3DS(bpy.types.Operator):
return {'FINISHED'}
def invoke(self, context, event):
- wm = context.manager
- wm.add_fileselect(self)
+ import os
+ if not self.properties.is_property_set("filepath"):
+ self.properties.filepath = os.path.splitext(bpy.data.filepath)[0] + ".3ds"
+
+ context.manager.add_fileselect(self)
return {'RUNNING_MODAL'}
- @classmethod
- def poll(cls, context): # Poll isnt working yet
- return context.active_object != None
# Add to a menu
def menu_func(self, context):
- default_path = os.path.splitext(bpy.data.filepath)[0] + ".3ds"
- self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)").filepath = default_path
+ self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)")
def register():
bpy.types.INFO_MT_file_export.append(menu_func)
+
def unregister():
bpy.types.INFO_MT_file_export.remove(menu_func)