I have this very simple scene setup in Blender :
I want to duplicate the collection named 'Lights_1_50' along with its contents and I found that every object in Blender has a copy()
method that can be used to duplicate the object. Blender collections also has that method and I tried to use it on the collection like so :
li= bpy.data.collections['Lights_1_50']
thingie= li.copy()
The code runs with no error but I don't see the new collection in the outliner which is weird because when I list all the collections in the console, I can see a collection named 'Lights_1_50.001' among the results :
and when I print thingie
on the console, I have the collection as output. Also if I change the outliner type to Blender file
, the collection is listed under Collections
:
But I don't see it anywhere else, it's not visible in the viewport.
What more do I need to do to have that collection inside my scene? Is there any step I missed or maybe this is not the proper way to duplicate a collection?
Thank you for your time.
Edit :
I also figured out that my code did not duplicate the objects but just linked the originals inside the new collection which is not really what I want so maybe the copy()
method is not what I'm looking for but I really have no idea of what else to try.