Blender does not remember the active ViewLayer properly after scene change #94076

Closed
opened 2021-12-14 21:35:21 +01:00 by kursad k · 7 comments
Member

System Information
Operating system: Windows 10

Blender Version
Broken: 3.0.0

Short description of error
Blender does not remember the currently active Viewlayer after scene switching. Please see the video.

Snx5lFx9rX.mp4

Exact steps for others to reproduce the error
Load the attach .blend
Change to scene B
Change the Viewlayer to "DONT"
Change to scene A
Change back to scene B
"DONT" Viewlayer is not active, instead it reverts to the other one.

vlayer_14122021_1432_13.blend

**System Information** Operating system: Windows 10 **Blender Version** Broken: 3.0.0 **Short description of error** Blender does not remember the currently active Viewlayer after scene switching. Please see the video. [Snx5lFx9rX.mp4](https://archive.blender.org/developer/F12742351/Snx5lFx9rX.mp4) **Exact steps for others to reproduce the error** Load the attach .blend Change to scene B Change the Viewlayer to "DONT" Change to scene A Change back to scene B "DONT" Viewlayer is not active, instead it reverts to the other one. [vlayer_14122021_1432_13.blend](https://archive.blender.org/developer/F12742365/vlayer_14122021_1432_13.blend)
Author
Member

Added subscriber: @kursadk

Added subscriber: @kursadk

Added subscriber: @Wovchick

Added subscriber: @Wovchick
Member

Added subscribers: @brecht, @lichtwerk

Added subscribers: @brecht, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Archived'

Changed status from 'Needs Triage' to: 'Archived'
Member

An active viewlayer means it is active for the window (not the scene), so a scene does not really have an active view layer (just a list/collection of view layers).
If you change the scene, blender will try to find the previous viewlayer (by name) in that scene as well. If it doesnt find it, the first in the scene's list will become active for the window.
If you set the view layer of your window to a view layer of an non-active scene, blender will just do nothing (well, not entirely, see below).

The reasoning (I think) is to be able to work on the same scene but different view layers for different tasks.
If the active view layer was tied to the scene this would not be possible.
It was even tied to workspaces once.
With the current design, you can have different viewlayers (but the same scene) in different windows, which allows for more workflows.

@brecht: I noticed it is possible to change the window view layer to a view layer not present in the current scene (by python).
There is an assert for it in WM_window_set_active_view_layer, but in Release builds, the "wrong" view layer name will be copied to the window's view_layer_name.
Did not notice problems in practice (maybe this is corrected again somewhere else shortly after), just saying... maybe we should just return early (instead of asserting) in that case?

So in regards to the report, this looks like it is working by design, thx reporting, but will close.

An active viewlayer means it is active for the **window (not the scene)**, so a scene does not really have an active view layer (just a list/collection of view layers). If you change the scene, blender will try to find the previous viewlayer (by name) in that scene as well. If it doesnt find it, the first in the scene's list will become active for the window. If you set the view layer of your window to a view layer of an non-active scene, blender will just do nothing (well, not entirely, see below). The reasoning (I think) is to be able to work on the same scene but different view layers for different tasks. If the active view layer was tied to the scene this would not be possible. It was even tied to workspaces once. With the current design, you can have different viewlayers (but the same scene) in different windows, which allows for more workflows. @brecht: I noticed it is possible to change the window view layer to a view layer not present in the current scene (by python). There is an assert for it in `WM_window_set_active_view_layer`, but in Release builds, the "wrong" view layer name will be copied to the window's `view_layer_name`. Did not notice problems in practice (maybe this is corrected again somewhere else shortly after), just saying... maybe we should just return early (instead of asserting) in that case? So in regards to the report, this looks like it is working by design, thx reporting, but will close.

Mismatched view layer names are always possible, for example loading another .blend file while keeping the UI. The code should be robust to that.

When doing this from Python it would indeed be better to not assert and just not set the name.

Mismatched view layer names are always possible, for example loading another .blend file while keeping the UI. The code should be robust to that. When doing this from Python it would indeed be better to not assert and just not set the name.
Author
Member

It would be nice if this is considered a bug given this is really a pipeline issue. A viewlayer also holds scene configuration and it is a bit of drag and friction to lose what is active between scenes in a production setup.

It would be nice if this is considered a bug given this is really a pipeline issue. A viewlayer also holds scene configuration and it is a bit of drag and friction to lose what is active between scenes in a production setup.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#94076
No description provided.