Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bpy
- # Deselect all objects first
- bpy.ops.object.select_all(action='DESELECT')
- # Select mesh objects with 2 or more material slots
- for obj in bpy.data.objects:
- if obj.type == 'MESH' and len(obj.material_slots) >= 2:
- obj.select_set(True)
- # Make one of the selected objects active (optional)
- selected = bpy.context.selected_objects
- if selected:
- bpy.context.view_layer.objects.active = selected[0]
Add Comment
Please, Sign In to add comment