Skip to content
Snippets Groups Projects
Commit a53fabc2 authored by Campbell Barton's avatar Campbell Barton
Browse files

minor syntax change

parent 371c55f5
No related branches found
No related tags found
No related merge requests found
...@@ -374,7 +374,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_ ...@@ -374,7 +374,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
#Create new materials #Create new materials
for name in unique_materials: # .keys() for name in unique_materials: # .keys()
if name != None: if name is not None:
unique_materials[name] = bpy.data.materials.new(name.decode('utf-8', "replace")) unique_materials[name] = bpy.data.materials.new(name.decode('utf-8', "replace"))
unique_material_images[name] = None, False # assign None to all material images to start with, add to later. unique_material_images[name] = None, False # assign None to all material images to start with, add to later.
...@@ -396,10 +396,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_ ...@@ -396,10 +396,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
pass pass
elif line.startswith(b'newmtl'): elif line.startswith(b'newmtl'):
context_material_name = line_value(line.split()) context_material_name = line_value(line.split())
if context_material_name in unique_materials: context_material = unique_materials.get(context_material_name)
context_material = unique_materials[context_material_name]
else:
context_material = None
elif context_material: elif context_material:
# we need to make a material to assign properties to it. # we need to make a material to assign properties to it.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment