[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31916] trunk/blender/release/scripts/op/ io_scene_obj/export_obj.py: Fix [#23761] OBJ exported materialname wrong

Nathan Letwory nathan at letworyinteractive.com
Tue Sep 14 02:45:37 CEST 2010


Revision: 31916
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31916
Author:   jesterking
Date:     2010-09-14 02:45:37 +0200 (Tue, 14 Sep 2010)

Log Message:
-----------
Fix [#23761] OBJ exported materialname wrong
Reported by Reiner Prokein.

Just use the material name instead of concatenating with any image names to it.

Modified Paths:
--------------
    trunk/blender/release/scripts/op/io_scene_obj/export_obj.py

Modified: trunk/blender/release/scripts/op/io_scene_obj/export_obj.py
===================================================================
--- trunk/blender/release/scripts/op/io_scene_obj/export_obj.py	2010-09-14 00:30:45 UTC (rev 31915)
+++ trunk/blender/release/scripts/op/io_scene_obj/export_obj.py	2010-09-14 00:45:37 UTC (rev 31916)
@@ -634,15 +634,9 @@
                             # First add to global dict so we can export to mtl
                             # Then write mtl
 
-                            # Make a new names from the mat and image name,
-                            # converting any spaces to underscores with fixName.
+                            # convert any spaces to underscores with fixName.
+                            mat_data = mtl_dict[key] = ('%s'%fixName(key[0])), materialItems[f_mat], f_image
 
-                            # If none image dont bother adding it to the name
-                            if key[1] == None:
-                                mat_data = mtl_dict[key] = ('%s'%fixName(key[0])), materialItems[f_mat], f_image
-                            else:
-                                mat_data = mtl_dict[key] = ('%s_%s' % (fixName(key[0]), fixName(key[1]))), materialItems[f_mat], f_image
-
                         if EXPORT_GROUP_BY_MAT:
                             file.write('g %s_%s_%s\n' % (fixName(ob.name), fixName(ob.data.name), mat_data[0]) ) # can be mat_image or (null)
 





More information about the Bf-blender-cvs mailing list