[Blender] 打印特定集合的子級
還在摸索著查blender的api手冊,存一下備忘。
#打印特定集合的子級
import bpy
for collection in bpy.data.collections["Collection"].children:
? ? ? print("collection: ", collection.name)
? ? ??
? ? ? for obj in collection.all_objects:
? ? ? ? ? print("object: ", obj.name)
資料來自幾年前的帖子,以及api手冊:
https://blender.stackexchange.com/questions/144928/how-to-list-all-collections-and-their-objects
https://docs.blender.org/api/current/bpy.types.Collection.html#collection-id

標簽: