How to link a new object to a scene in Blender 2.80 Python API

In Blender 2.79 Python API we can add a new object to a scene with:

If we try to do this in Blender 2.80, it throws an error:

‘bpy_prop_collection’ object has no attribute ‘link’

In Blender 2.80 API new objects mast be linked not to the scene, but to the scene collections:

To link a new object to the active scene collection:

To link a new object to the collection by its name:


0 0 votes
Article Rating
Notify of
2 Comment
Oldest Most Voted
Inline Feedbacks
View all comments
1 month ago

you can also assign object to a scene without using context, by:

Last edited 1 month ago by Terefere
1 month ago
Reply to  Terefere

Yes. Thank you!