0

I want to select all objects in a collection (collection names are known).

pseudo:

selectedObjs1 = allObjectsInCollectionName; <--- How?
for all objects in selectedObjs1:
    process...

Thanks.

Xvier
  • 3
  • 2

1 Answers1

2

If you want to process every object in a collection, you would have to iterate through Collection.all_objects:

collection = bpy.data.collections["collection_name"]
for obj in collection.all_objects:
    print(obj.name) 

Further reading: How to list all collections and their objects?

brockmann
  • 12,613
  • 4
  • 50
  • 93
Tomreggae
  • 326
  • 1
  • 9