Skip to main content
3 of 3
edited title
Gorgious
  • 31.8k
  • 2
  • 49
  • 106

How do I iterate over all selected objects and change a property on their materials?

import bpy 

for material_slot in bpy.data.objects['Cube'].material_slots:
    material_slot.material.show_transparent_back = False

I have managed to access to the data of one object by name in Blender 2.93, but I cannot find a way to do it for all selected objects instead of by name.

pekkuskär
  • 317
  • 2
  • 11