[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3291] trunk/py/scripts/addons/ io_scene_obj/export_obj.py: Fix [#31039] Obj export adds blendfile name to the texture names (and [31040] too).

Bastien Montagne montagne29 at wanadoo.fr
Fri Apr 20 21:45:06 CEST 2012


Revision: 3291
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3291
Author:   mont29
Date:     2012-04-20 19:45:05 +0000 (Fri, 20 Apr 2012)
Log Message:
-----------
Fix [#31039] Obj export adds blendfile name to the texture names (and [31040] too).

bpy_extras.io_utils.path_reference() expects a real dir as base_src, not the blend file name!

Modified Paths:
--------------
    trunk/py/scripts/addons/io_scene_obj/export_obj.py

Modified: trunk/py/scripts/addons/io_scene_obj/export_obj.py
===================================================================
--- trunk/py/scripts/addons/io_scene_obj/export_obj.py	2012-04-20 11:08:38 UTC (rev 3290)
+++ trunk/py/scripts/addons/io_scene_obj/export_obj.py	2012-04-20 19:45:05 UTC (rev 3291)
@@ -42,13 +42,13 @@
     else:
         world_amb = Color((0.0, 0.0, 0.0))
 
-    source_dir = bpy.data.filepath
+    source_dir = os.path.dirname(bpy.data.filepath)
     dest_dir = os.path.dirname(filepath)
 
     file = open(filepath, "w", encoding="utf8", newline="\n")
     fw = file.write
 
-    fw('# Blender MTL File: %r\n' % os.path.basename(bpy.data.filepath))
+    fw('# Blender MTL File: %r\n' % (os.path.basename(bpy.data.filepath) or "None"))
     fw('# Material Count: %i\n' % len(mtl_dict))
 
     mtl_dict_values = list(mtl_dict.values())



More information about the Bf-extensions-cvs mailing list