[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [1212] trunk/py/scripts/addons/ animation_rotobezier.py: Simplifying material check thanks to the teachings of Master Campbell

Daniel Salazar zanqdo at gmail.com
Tue Nov 30 06:35:35 CET 2010


Revision: 1212
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=1212
Author:   zanqdo
Date:     2010-11-30 06:35:35 +0100 (Tue, 30 Nov 2010)

Log Message:
-----------
Simplifying material check thanks to the teachings of Master Campbell

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

Modified: trunk/py/scripts/addons/animation_rotobezier.py
===================================================================
--- trunk/py/scripts/addons/animation_rotobezier.py	2010-11-30 00:32:09 UTC (rev 1211)
+++ trunk/py/scripts/addons/animation_rotobezier.py	2010-11-30 05:35:35 UTC (rev 1212)
@@ -231,14 +231,6 @@
     Obj = bpy.context.active_object
     
     # Material
-    def CheckMat (MatName):
-        Result = False
-        Mats = bpy.data.materials
-        for Mat in Mats:
-            if Mat.name == MatName:
-                Result = not Result
-        
-        return Result
     
     if Type == 'White':
         MatName = 'RotoBezier_WhiteMatte'
@@ -248,7 +240,7 @@
         MatName = 'RotoBezier_BlackMatte'
         MatCol = (0,0,0)
 
-    if CheckMat(MatName):
+    if bpy.data.materials.get(MatName):
         Mat = bpy.data.materials[MatName]
         if not Obj.material_slots:
             bpy.ops.object.material_slot_add()




More information about the Bf-extensions-cvs mailing list