Is there a way to change the view layer in a linked scene?

Here is the thing, I have a big scene that is under continuous changes so to setup cameras and similar things I decided to link the whole scene, the problem is that we have 4 view layers for rendering in that scene, and for my “main” scene where the cameras are I need to enable a different view layer to the one that is active in the linked file.

Is there a way to do so?

Switching to the View Layer works just like normal. But changing the use for rendering flag is not possible from the UI afaik. So that flag would need to be set in the source file. It can be temporarily set via Python, so you can try bpy.context.view_layer.use = False or bpy.context.view_layer.use = True from a Python console. This won’t be saved with the file though.

1 Like

But the view layers are not visible for me in the view layers menu, how can I change from one to another?

EDIT: Ok… now that I think about it, I have to go into the scene, change the view layer and go back, thanks :slight_smile:

I don’t need to change the use for rendering setting because I’m using the scene as background, but thanks for the tip, I will probably need it in the near future

Ok, nope, that does not work, when I set the scene as background in a different scene I only get the first viewlayer, which is not the one I need, any other idea?

not sure if I really get the problem. I can switch View Layers when the scene is linked no problem:

1 Like

In the example “scene”, the non linked one, go to the “scene settings”, where you define the camera, and in the background slot select your linked “scene” (you may need to change the name of the first “scene”, the non linked one, for it to work) then go to the linked “scene” and change the view layer to a different one, go back to the non-Linked “scene” and the result should be that the view layer you picked was the one shown, but you will discover that it was not changed at all

Ah right, got ya now. Can’t think of a simple workaround for this at the moment. We were using Background Scenes in the past too, but have stopped doing so, as there is no control over the BG scene from the current one (this is not even connected to the file being linked, it simply doesn’t work that way).

We used to have certain scene elements, like floor, background, lights, in the BG scene. From the current scene you could toggle layer visibility, and the BG scene would toggle the same layers. This propagated even into the renders and was quite handy. For us we can work around this using collection instances instead of BG scenes, but for you this might not be an option. Collections don’t reflect the exclude states for instance, which are one of the main reasons to even have view layers.

1 Like

We would need something like this (if a Background Scene is set):

BGScene

1 Like

Yes, that’s a very good idea :slight_smile:

There is a workaround.

You can create a linked copy of your scene, delete all View Layers except wanted one inside the copy.
And, then, use linked copy as background scene.

If you want to be able to switch between all view layers of original scene, you are forced to create as many linked copies as wanted View Layers.

1 Like

I managed to get the view layer I wanted by enabling the “Use for rendering” in the specific view layer I wanted, and then that view layer was the one active when using the scene as background, not too bad, but a view layer control is in order for this.

Or even better, a node based scene assembly tool, to be able to link and unlink scenes with different collections enabled/disabled, etc…

3 Likes