We can quickly activate all collections in Blender on the current view layer – enable the “checkbox”, “eye” and “monitor” icons for all of them, using a simple script.
The “hide_viewport” parameter for scene collection objects is responsible for turning the collection on and off for the entire scene (icon with a monitor).
To enable this parameter globally, let’s loop through all collections in the scene and set it to False.
1 2 |
for collection in bpy.data.collections: collection.hide_viewport = False |
The same “hide_viewport” parameter and the “exclude” parameter for the view layer collection objects are responsible for enabling or disabling collections for display in the viewport (icon with an eye) and general accessing of collections (checkbox icon).
To globally enable these parameters, we need to loop through all the view layer collections and assign them False.
1 2 3 |
for collection in bpy.context.view_layer.layer_collection.children: collection.hide_viewport = False collection.exclude = False |
Full script code that will enable all three parameters for all collections:
1 2 3 4 5 6 7 8 |
import bpy for collection in bpy.context.view_layer.layer_collection.children: collection.hide_viewport = False collection.exclude = False for collection in bpy.data.collections: collection.hide_viewport = False |
To completely turn off all collections, call this script, replacing False with True.