acoolrocket

Blender - Select meshes with two or more material slots (For Alembic workflow)

Jun 19th, 2026
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import bpy
  2.  
  3. # Deselect all objects first
  4. bpy.ops.object.select_all(action='DESELECT')
  5.  
  6. # Select mesh objects with 2 or more material slots
  7. for obj in bpy.data.objects:
  8. if obj.type == 'MESH' and len(obj.material_slots) >= 2:
  9. obj.select_set(True)
  10.  
  11. # Make one of the selected objects active (optional)
  12. selected = bpy.context.selected_objects
  13. if selected:
  14. bpy.context.view_layer.objects.active = selected[0]
Add Comment
Please, Sign In to add comment