[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30320] trunk/blender/release/scripts: bugfix [#22843] Cannot export to folder with ".blend" on the end.

Campbell Barton ideasman42 at gmail.com
Wed Jul 14 13:58:19 CEST 2010


Revision: 30320
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30320
Author:   campbellbarton
Date:     2010-07-14 13:58:19 +0200 (Wed, 14 Jul 2010)

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

Modified Paths:
--------------
    trunk/blender/release/scripts/io/export_3ds.py
    trunk/blender/release/scripts/io/export_fbx.py
    trunk/blender/release/scripts/io/export_mdd.py
    trunk/blender/release/scripts/io/export_obj.py
    trunk/blender/release/scripts/io/export_ply.py
    trunk/blender/release/scripts/io/export_x3d.py
    trunk/blender/release/scripts/op/object.py
    trunk/blender/release/scripts/op/uv.py

Modified: trunk/blender/release/scripts/io/export_3ds.py
===================================================================
--- trunk/blender/release/scripts/io/export_3ds.py	2010-07-14 11:56:05 UTC (rev 30319)
+++ trunk/blender/release/scripts/io/export_3ds.py	2010-07-14 11:58:19 UTC (rev 30320)
@@ -1140,7 +1140,7 @@
 
 # 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 @@
 
 if __name__ == "__main__":
     register()
-

Modified: trunk/blender/release/scripts/io/export_fbx.py
===================================================================
--- trunk/blender/release/scripts/io/export_fbx.py	2010-07-14 11:56:05 UTC (rev 30319)
+++ trunk/blender/release/scripts/io/export_fbx.py	2010-07-14 11:58:19 UTC (rev 30320)
@@ -3437,7 +3437,7 @@
 
 
 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
 
 

Modified: trunk/blender/release/scripts/io/export_mdd.py
===================================================================
--- trunk/blender/release/scripts/io/export_mdd.py	2010-07-14 11:56:05 UTC (rev 30319)
+++ trunk/blender/release/scripts/io/export_mdd.py	2010-07-14 11:58:19 UTC (rev 30320)
@@ -183,7 +183,8 @@
 
 
 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
 
 

Modified: trunk/blender/release/scripts/io/export_obj.py
===================================================================
--- trunk/blender/release/scripts/io/export_obj.py	2010-07-14 11:56:05 UTC (rev 30319)
+++ trunk/blender/release/scripts/io/export_obj.py	2010-07-14 11:58:19 UTC (rev 30320)
@@ -964,7 +964,7 @@
 
 
 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
 
 

Modified: trunk/blender/release/scripts/io/export_ply.py
===================================================================
--- trunk/blender/release/scripts/io/export_ply.py	2010-07-14 11:56:05 UTC (rev 30319)
+++ trunk/blender/release/scripts/io/export_ply.py	2010-07-14 11:58:19 UTC (rev 30320)
@@ -310,7 +310,8 @@
 
 
 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
 
 

Modified: trunk/blender/release/scripts/io/export_x3d.py
===================================================================
--- trunk/blender/release/scripts/io/export_x3d.py	2010-07-14 11:56:05 UTC (rev 30319)
+++ trunk/blender/release/scripts/io/export_x3d.py	2010-07-14 11:58:19 UTC (rev 30320)
@@ -1242,7 +1242,7 @@
 
 
 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 @@
 
 if __name__ == "__main__":
     register()
-

Modified: trunk/blender/release/scripts/op/object.py
===================================================================
--- trunk/blender/release/scripts/op/object.py	2010-07-14 11:56:05 UTC (rev 30319)
+++ trunk/blender/release/scripts/op/object.py	2010-07-14 11:58:19 UTC (rev 30320)
@@ -131,11 +131,11 @@
 
                 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'}

Modified: trunk/blender/release/scripts/op/uv.py
===================================================================
--- trunk/blender/release/scripts/op/uv.py	2010-07-14 11:56:05 UTC (rev 30319)
+++ trunk/blender/release/scripts/op/uv.py	2010-07-14 11:58:19 UTC (rev 30320)
@@ -210,7 +210,8 @@
 
 
 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
 
 





More information about the Bf-blender-cvs mailing list