Collection Iteration in Blender

PHOTO EMBED

Thu May 26 2022 13:39:06 GMT+0000 (Coordinated Universal Time)

Saved by @vjg #python

collection = bpy.data.collections["collection_name"]
for obj in collection.all_objects:
	//example #1
	obj.data.bevel_depth = 0.0005
	//example #2
	print(obj.name)
	//example #3
	obj.location[2] = 0
content_copyCOPY

It helps to make repetitive changes to multiple objects inside a collection in Blender. The parameter depends on the kind of object. For example, it doesn't make sense to try to change bevel_depth in a mesh object.

https://blender.stackexchange.com/questions/205286/how-can-i-select-all-objects-in-a-collections-using-python