From 1a58c6af7e822766d8d430dbfa35bb147c3aa38a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 14 Sep 2010 01:10:20 +0000 Subject: [PATCH] revert 31916, while having the image name and the material name mixed, this is intentional else texface export breaks. ideally this would only happen in cases where there are more then 1 image so we could avoid ugly names in common cases. svn merge -r31916:31915 release/scripts/op/io_scene_obj/export_obj.py --- release/scripts/op/io_scene_obj/export_obj.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/release/scripts/op/io_scene_obj/export_obj.py b/release/scripts/op/io_scene_obj/export_obj.py index c1969da9d53..01f5b221546 100644 --- a/release/scripts/op/io_scene_obj/export_obj.py +++ b/release/scripts/op/io_scene_obj/export_obj.py @@ -634,8 +634,14 @@ def write_file(filepath, objects, scene, # First add to global dict so we can export to mtl # Then write mtl - # convert any spaces to underscores with fixName. - mat_data = mtl_dict[key] = ('%s'%fixName(key[0])), materialItems[f_mat], f_image + # Make a new names from the mat and image name, + # converting any spaces to underscores with fixName. + + # 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)