Operators for globally hiding objects in all project scenes

To hide an object in the 3D Viewport window for the current scene we use the “object.hide_view_set” operator, which calls when we clicking the icon with an “eye” in the outliner. However, to hide the object in the viewport for all scenes of the project at once (clicking on the icon with the “monitor” image) a special operator is not provided. We can make it ourselves.

 

Difference between the “eye” and the “monitor” icons when hiding objects

To hide objects in the 3D Viewport window, we can click the “eye” icon in the outliner near the desired object name (press the “H” shortcode), or we can click the icon with the “monitor” image. In both cases, the object will be hidden.

So, what’s the difference between these two variants?

It is very simple:

Clicking on the “eye” icon hides objects only in the currently active scene of the blend file.

Pressing the icon with the “monitor” hides objects in all scenes of the blend file at once.