How to set visibility on view layers via python?


What was obj.hide in Blender 2.79 is now obj.hide_viewport in 2.80.

This is different from the visibility on view layers, which describes visibility on different viewlayers, and is what the default show/hide ops manipulate and what the eye icons in the outliner represent.

Using obj.visible_get() you can return the the visibility state on the active view layer.

There is no visible_set() method however, as far as I can tell. So how can you set the visibility on the active or other view layers?

An object hidden via the hide_viewport prop, can not be unhidden by the user using ALT + H for example.