diff options
author | Paul Geraskin <paul_geraskin@mail.ru> | 2013-07-30 14:13:50 +0400 |
---|---|---|
committer | Paul Geraskin <paul_geraskin@mail.ru> | 2013-07-30 14:13:50 +0400 |
commit | 19d9601571c8295d320035190ac712159d5d7123 (patch) | |
tree | 59fed4c730ce8f0f0de51312ec1c50cc8845d432 /uv_texture_atlas.py | |
parent | 0c72812d920ff02de10c11e0ba763cb0485d81e3 (diff) |
[TextureAtlas] small refactoring.
Diffstat (limited to 'uv_texture_atlas.py')
-rw-r--r-- | uv_texture_atlas.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/uv_texture_atlas.py b/uv_texture_atlas.py index 3dbf8cb7..a3744a6d 100644 --- a/uv_texture_atlas.py +++ b/uv_texture_atlas.py @@ -617,13 +617,11 @@ class MergeObjects(Operator): # Add material to a tempObject if there are no materialSlots on the object if len(activeNowObject.material_slots) == 0: - mat = None matName = "zz_TextureAtlas_NO_Material" + mat = bpy.data.materials.get(matName) - if bpy.data.materials.get(matName) is None: + if mat is None: mat = bpy.data.materials.new(matName) - else: - mat = bpy.data.materials[matName] activeNowObject.data.materials.append(mat) |