
I want to iterate over the material index of material slot and change the value of each material index. How can this be done in Python?
I've tried using the Python shown below, but it doesn't work correctly.
import bpy
object = bpy.context.object
material = object.active_material
for num in range(0, 5):
object.active_material_index = num
if material.use_shadeless:
material.use_shadeless = False
else:
material.use_shadeless = True