diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-06-13 13:33:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-06-13 13:33:55 +0400 |
commit | 2f1e118c30946bd3117c59cd45f13d79e4b612ec (patch) | |
tree | 756d5cb2c41b406bebc7132d737d9a841ae9d647 | |
parent | 2183af57608d87305d861e5d77ac5bfa49328d22 (diff) |
in some cases importing without materials could raise a python error.
surprising nobody found before.
reported by <chewed-on> who doesnt want his real name used for some reason.
-rw-r--r-- | release/scripts/import_obj.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/release/scripts/import_obj.py b/release/scripts/import_obj.py index 865e4b1bb95..d88f06a2a47 100644 --- a/release/scripts/import_obj.py +++ b/release/scripts/import_obj.py @@ -166,12 +166,13 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_ del temp_mtl #Create new materials - for name in unique_materials.iterkeys(): - unique_materials[name]= bpy.data.materials.new(name) - - unique_material_images[name]= None, False # assign None to all material images to start with, add to later. + for name in unique_materials: # .keys() + if name != None: + unique_materials[name]= bpy.data.materials.new(name) + unique_material_images[name]= None, False # assign None to all material images to start with, add to later. unique_materials[None]= None + unique_material_images[None]= None, False for libname in material_libs: mtlpath= DIR + libname |