Final Gather Visualizer and Render Layers


Recently a friend of mine was using the Final Gather Map Visualizer to diagnose and set the FG of the scene she was working on. One annoying thing though, it was only visible on one Render Layer. After some reading in the documentation of Maya, it appears the Final Gather Visualizer is actually a node: mapVizShape.

If it is a node, then it must be added to the Render Layer to be displayed on that specific Render Layer. To do so, filter mapViz in the outliner and then add it to the Render Layer or just execute that little piece of Python.

import maya.cmds as cmds
if cmds.objExists("mapViz*"):
    mapViz = cmds.ls ("mapViz*", transforms = True)

    renderLayers = cmds.ls(type = "renderLayer")

    for layer in renderLayers[1:]:
        listConnections = cmds.listConnections(layer, source = False)
        nodePresentInLayer = set(listConnections).intersection(mapViz)
        if not nodePresentInLayer:
            cmds.editRenderLayerMembers(layer, mapViz)

Now all your Render Layers can display the Final Gather points in the viewport! Don’t forget to execute it each time you create a new layer.