Hello. Can I get the name of the collection for selected objects or object to get in the console for example?
The following should be functional in blender 4.1
Keep in mind a single object can potentially be linked to multiple collections.
import bpy sel_objs = bpy.context.selected_objects def op_names(objs): for obj in objs: print(f"obj: {obj.name}", end='') for coll in obj.users_collection: print(f"\t coll: {coll.name}", end='') print() op_names(sel_objs)