Skip to content
Snippets Groups Projects
Commit fc1a29b3 authored by Daniel Salazar's avatar Daniel Salazar
Browse files

Simplifying material check thanks to the teachings of Master Campbell

parent ad83e136
No related branches found
No related tags found
No related merge requests found
...@@ -231,14 +231,6 @@ def MakeMatte (Type): ...@@ -231,14 +231,6 @@ def MakeMatte (Type):
Obj = bpy.context.active_object Obj = bpy.context.active_object
# Material # 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': if Type == 'White':
MatName = 'RotoBezier_WhiteMatte' MatName = 'RotoBezier_WhiteMatte'
...@@ -248,7 +240,7 @@ def MakeMatte (Type): ...@@ -248,7 +240,7 @@ def MakeMatte (Type):
MatName = 'RotoBezier_BlackMatte' MatName = 'RotoBezier_BlackMatte'
MatCol = (0,0,0) MatCol = (0,0,0)
if CheckMat(MatName): if bpy.data.materials.get(MatName):
Mat = bpy.data.materials[MatName] Mat = bpy.data.materials[MatName]
if not Obj.material_slots: if not Obj.material_slots:
bpy.ops.object.material_slot_add() bpy.ops.object.material_slot_add()
......
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