[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4642] trunk/py/scripts/addons/ uv_texture_atlas.py: [TextureAtlas] small refactoring.

paul geraskin paul_geraskin at mail.ru
Tue Jul 30 12:13:50 CEST 2013


Revision: 4642
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4642
Author:   mifth
Date:     2013-07-30 10:13:50 +0000 (Tue, 30 Jul 2013)
Log Message:
-----------
[TextureAtlas] small refactoring.

Modified Paths:
--------------
    trunk/py/scripts/addons/uv_texture_atlas.py

Modified: trunk/py/scripts/addons/uv_texture_atlas.py
===================================================================
--- trunk/py/scripts/addons/uv_texture_atlas.py	2013-07-30 10:04:33 UTC (rev 4641)
+++ trunk/py/scripts/addons/uv_texture_atlas.py	2013-07-30 10:13:50 UTC (rev 4642)
@@ -617,13 +617,11 @@
 
             # 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)
 



More information about the Bf-extensions-cvs mailing list