bugfix [#22843] Cannot export to folder with ".blend" on the end.

This commit is contained in:
Campbell Barton
2010-07-14 11:58:19 +00:00
parent fef943873c
commit 80355fd456
8 changed files with 14 additions and 13 deletions

View File

@@ -1140,7 +1140,7 @@ class Export3DS(bpy.types.Operator):
# Add to a menu
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".3ds")
default_path = os.path.splitext(bpy.data.filepath)[0] + ".3ds"
self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)").filepath = default_path
@@ -1154,4 +1154,3 @@ def unregister():
if __name__ == "__main__":
register()

View File

@@ -3437,7 +3437,7 @@ class ExportFBX(bpy.types.Operator):
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".fbx")
default_path = os.path.splitext(bpy.data.filepath)[0] + ".fbx"
self.layout.operator(ExportFBX.bl_idname, text="Autodesk FBX (.fbx)").filepath = default_path

View File

@@ -183,7 +183,8 @@ class ExportMDD(bpy.types.Operator):
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".mdd")
import os
default_path = os.path.splitext(bpy.data.filepath)[0] + ".mdd"
self.layout.operator(ExportMDD.bl_idname, text="Lightwave Point Cache (.mdd)").filepath = default_path

View File

@@ -964,7 +964,7 @@ class ExportOBJ(bpy.types.Operator):
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".obj")
default_path = os.path.splitext(bpy.data.filepath)[0] + ".obj"
self.layout.operator(ExportOBJ.bl_idname, text="Wavefront (.obj)").filepath = default_path

View File

@@ -310,7 +310,8 @@ class ExportPLY(bpy.types.Operator):
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".ply")
import os
default_path = os.path.splitext(bpy.data.filepath)[0] + ".ply"
self.layout.operator(ExportPLY.bl_idname, text="Stanford (.ply)").filepath = default_path

View File

@@ -1242,7 +1242,7 @@ class ExportX3D(bpy.types.Operator):
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".x3d")
default_path = os.path.splitext(bpy.data.filepath)[0] + ".x3d"
self.layout.operator(ExportX3D.bl_idname, text="X3D Extensible 3D (.x3d)").filepath = default_path
@@ -1259,4 +1259,3 @@ def unregister():
if __name__ == "__main__":
register()

View File

@@ -131,11 +131,11 @@ class SelectHierarchy(bpy.types.Operator):
if parent:
parents.append(parent)
if obj_act == obj:
context.scene.objects.active = parent
parent.selected = True
if obj_act == obj:
context.scene.objects.active = parent
parent.selected = True
if parents:
return {'CANCELLED'}

View File

@@ -210,7 +210,8 @@ class ExportUVLayout(bpy.types.Operator):
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".svg")
import os
default_path = os.path.splitext(bpy.data.filepath)[0] + ".svg"
self.layout.operator(ExportUVLayout.bl_idname).filepath = default_path