From fc1a29b3a9bc9108897bded7b5b05507e3e3d5c3 Mon Sep 17 00:00:00 2001
From: Daniel Salazar <zanqdo@gmail.com>
Date: Tue, 30 Nov 2010 05:35:35 +0000
Subject: [PATCH] Simplifying material check thanks to the teachings of Master
 Campbell

---
 animation_rotobezier.py | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/animation_rotobezier.py b/animation_rotobezier.py
index 92ae49d81..c49a72eb8 100644
--- a/animation_rotobezier.py
+++ b/animation_rotobezier.py
@@ -231,14 +231,6 @@ def MakeMatte (Type):
     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 @@ def MakeMatte (Type):
         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()
-- 
GitLab