Active collection

To get the current active collection through the Blender Python API we need to access it through the “view_layer” layer.

The following command will return the active collection from the scene:

The active collection can also be accessed directly through the current context:

Note that toggling the collection visibility in the outliner using the “eye” and “monitor” icons resets the currently active collection and makes the scene’s main collection active.


*.blend file with the example code for my Patreon subscribers

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments