[SOLVED] Changing view layers in command line renders

addons

#1

Hi guys, I’m updating one of my addons and one things I can’t seem to do is disable view layers in command line renders. I know the “Render Single Layer” setting doesn’t work for CLI renders (as per the tooltip). But it seems disabling the layers and enabling a single one also doesn’t work?

I run this code from a python script passed with -P:

for l in scene.view_layers:
    l.use = (l.name == job["layer"])


#2

Never mind folks. It was an bug in how I generated the code :expressionless:
The snippet above actually works, in case anyone has to pick a view layer for CLI renders