exporters now set the filepath in the invoke() method rather then the menu drawing function.

This commit is contained in:
2010-08-13 06:45:33 +00:00
parent bf52b68dcd
commit f662c0de05
7 changed files with 42 additions and 35 deletions

View File

@@ -1205,14 +1205,16 @@ class ExportX3D(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] + ".x3d"
context.manager.add_fileselect(self)
return {'RUNNING_MODAL'}
def menu_func(self, context):
default_path = os.path.splitext(bpy.data.filepath)[0] + ".x3d"
self.layout.operator(ExportX3D.bl_idname, text="X3D Extensible 3D (.x3d)").filepath = default_path
self.layout.operator(ExportX3D.bl_idname, text="X3D Extensible 3D (.x3d)")
def register():