mercredi 26 juin 2019

Blender code: loop by index in range


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
import bpy

print("*****************")
print("This Loop Trough Multi Materials")
selection = bpy.context.object
print("SELECTED OBJECT: "+selection.name)
index = -1
for num, m in enumerate(bpy.context.object.material_slots):
    num+=1    
    bpy.context.object.active_material_index = num
    print(num)
    mat = bpy.context.object.active_material
    print(mat)

Aucun commentaire:

Enregistrer un commentaire