Maya Render Setup layer renders all lights in layer - only in mayabatch

We’ve only recently started switching to Render Setup coming from Maya Legacy’s renderlayers and we’re facing an issue with a specific ‘understanding’ or ‘misunderstanding’ as to why a render differs in render output in Mayabatch compared to running it inside the Maya interface.

It seems in Mayabatch all lights, even when not added in a collection in the Render Setup layer will be used for rendering during Mayabatch even though in Maya running V-Ray in the UI it will only render with the actual lights contained in that particular layer.

Attached is a scene reproducing the issue.

The scene has three lights, a dome light, a spot light and a rectangular light. Then we’ve made three layers each containing only one light (purely as an example - we understand for this case we could use light groups in a single layer but it’s just to show the issue.)
In this case it’s done with an expression for the Render Setup layer, but we’ve seen the same happen when the lights are explicitly added to each layer.

When rendering through Deadline somehow all layers contain all lights where I’d expect each layer to have only that specific light.

Tested with:
V-Ray 5 for Maya version 5.00.20 from Aug 5 2020, 16:06:17
Autodesk Maya 2020.3

The only workaround really that works fine in mayabatch is explicitly forcing the layers to disable visibility of the other lights (basically including those lights, but disabling them). However, with the lights not even included in the layer I’d expect, like when rendering within Maya GUI that lights not in the layer are ignored.
render_test_vray_v001.zip (16.5 KB)

It seems the “Include all lights in each renderlayer by default” setting in Render Setup isn’t saved with the scene but set for the individual maya session.

Which is stored in an optionVar renderSetup_includeAllLights or can be set as environment variable: MAYA_RENDER_SETUP_INCLUDE_ALL_LIGHTS. Ugh!
That is bound to create some inconsistencies. :slight_smile:
We’re forcing the variable now to 0 within our pipeline environment so all machines behave the same. :slight_smile:
So, MAYA_RENDER_SETUP_INCLUDE_ALL_LIGHTS=0 is the winner today.

I guess this solves the issue.

Its a feature, not a bug. :rage:
But a very poor design decision from Autodesk.

hey just ran into this today in 2020.4. For anyone that has the same issue, an easy per scene workaround is adding Pre-Render MEL command in your common render globals. This should force this setting on render nodes and get things rendering as expected. Worked for me when submitting to Deadline.


optionVar -iv "renderSetup_includeAllLights" 0