Thursday, July 9, 2009

The fail that is render layers

Building a lighting pipeline for anything beyond simple CG characters is complex. Compositing wants specific layers, with secondary outputs of diffuse, specular, shadow, depth, uv, world position, and many, many others. Different layers need different shader assignments and different rendering attributes. Maya's solution to this appeared in Maya 7 and is called "Render Layers".

Render Layers works like this: there is one layer by default. It's a node, called defaultRenderLayer1. Confusingly, it ends up called "Master Layer" in the Render Layers window, but no matter. The Master Layer contains all geometry in the scene, the default settings. Now, if you create a new render layer and make it current, you can create a per-layer override for any attribute on any object.

"That sounds great!", I thought to myself. And merrily the lighters went about creating render layers, assigning different shaders and... wait, why won't that shader attach? What does that obscure error message mean? Why are all my shader assignments reset when I re-open my scene?

Turns out that Render Layers do not play well with references. Meaning, they don't work. They break. The only solution is to import all the references in your scene, cross your fingers, and hope that it all works in the ends.

In the pipeline for a large show, we often want to reuse work wherever possible. So, if we have a sequence with 30 or so nearly identical shots, we'd ideally like to reuse the lighting, layers, and per-layer overrides from a single shot (the "key" shot) as a starting point for all the other shots. So, of course, Aliasdesk must have included a simple way to export a render layer as a MEL script? Right? Right?

No.

FAIL!

2 comments:

  1. fixrenderlayeroutadjustmenterrors.mel (by Aliasdesk ,) will help (sometimes)

    (http://mayastation.typepad.com/files/fixrenderlayeroutadjustmenterrors.mel)

    cheers
    F

    ReplyDelete
  2. Probably super late to the party, but I came accross the same problem using Maya 2012 (It seems it hasn't been solved yet), and I found that using the Outliner's Display DAG Objects Only and turning it off, I could see the default render layers. Apparently it creates a new default render layer per each referenced file, so once your scene is final and ready to render, Import files from references and manually delete those default render layers. It should work.

    Cheers

    ReplyDelete