Depsgraph ownership: scene layer inconsistencies
Closed, ResolvedPublic


Short description of error
Right some parts of Blender follow the workspace render layer, while others follow the scene active render layer.

Detailed description of error
We should create depsgraph based on per-scene_layer basis, meaning, we should replace build_scene with build_scene_layer. But it's not trivial for until we change ownership of depsgraph to be per-scene_layer (with some workspace or window involved into the key) or something like this.


Dalai Felinto (dfelinto) triaged this task as Confirmed priority.

Suggested workaround by @Sergey Sharybin (sergey):

You might add temporary workaround and rebuild depsgraph when one changes scene layer, but that's not how final design should work.

Perhaps if you add some api to get depsgraph for a given context or layer it will all be localized. Something like: if requested scene layer != requested scene layer then rebuild depsgraph. Otherwise return scene->depsgraph. Later in it'll be one place where we would need to replace that with real hash lookup or so.

If you go that route, please make it so argument list is complete from the log term point of view. As in, so we wouldn't need to go over everywhere changing arguments we pass there.

Some extra directions for depsgraph ownership:

  • workspace + render layer defines a despsgraph.
    • technically it is workspace + scene + render layer
    • when workspace has "use_scene_settings" on it uses the render layer from the scene, but since it's a settings in the workspace level, it is still one depsgraph for this workspace.
  • Render (F12) defines a depsgraph
  • Local view (/) will define a depsgraph, or re-use the workspace depsgraph with some bitflag visibility system (like we had in 2.7)
Sergey Sharybin (sergey) closed this task as Resolved.Dec 19 2017, 11:41 AM

Think we can consider this solved. There might be still bugs here or there, but bigger picture is implemented i'd say.