Skip to main content
Became Hot Network Question
Tweeted twitter.com/StackBlender/status/1405857834286342146
edited title
Link
Gorgious
  • 31.8k
  • 2
  • 49
  • 106

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

edited title
Link
Gorgious
  • 31.8k
  • 2
  • 49
  • 106

Access object data for How do I iterate over all selected objects?

Source Link
pekkuskär
  • 317
  • 2
  • 11

Access object data for selected objects

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.