Command Line Render Layer Selection
Simple idea, just add a "-l" or something like that to be abble to render a single layer from a single scene in a Command line render.
ie:
blender -b C:\...\Project\Name.blend -S Scene_Name -l Layer_Name -a
You can do this from inside Blender using the Render Sinlge Layer but you can not, as it states in the tooltip, from command line... sigh
This is a must if you are rendering lots of scenes, layers and aovs to composite it later on. And, sometimes, you just need to slightly change a layer and it's horrible to must render a hole scene just because of that...
3 Comments
In the meantime, you can probably write a python script with all the extra options that Blender's cli doesn't provide 🤔
To be honest I have no idea how to start doing this at all ...
As we can see on Command Line Arguments — Blender Manual :
To force Blender's render only one specific view layer, we need to disable all other render layer for rendering. So let's make a file named " layer_select.py ", open it with a text editor like notepad or Blender's test editor, and save the following code inside:
Where
LAYER NAMEis your layer name as displayed in Blender. Be careful of preferring Latin characters without special characters other than underscores and dashes, otherwise running these commands from command lines and other softwares might produce issues.Now, to easily use it in cli, it's better to put this .py file in the same place as the .blend file. And using the cli will look like this:
It will render only the layer you asked in the .py file. You can manually write a different layer name in the .py file between each render, or make different .py files with the adequate layer name and change the .py path in your cli.