I'm currently trying to figure out how i can change the active view layer with python. The change to 2.8 made sourcing for documentation quite difficult.
I'd be thankfull for any help!
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
For simplicity now, we stick to having a single ‘active View Layer’ per Blender window.
view_layer property of the context window to the view layer you wish to be active for that window.
Example using py console. I have 3 viewlayers "RenderLayer", "View Layer" and "XXXX", code below sets "XXXX" as active in current (context) window.
>>> vl = C.scene.view_layers[' RenderLayer'] View Layer'] XXXX'] >>> vl = C.scene.view_layers['XXXX'] >>> C.window.view_layer = vl >>>