Exporting VRay light intensities in EXR metadata

One workflow optimisation I often find myself using is writing out the light values to the EXR metadata of a render from VRay and rebalancing in Nuke. This allows me to focus more on the placement and size of lights, and roll my corrected light values in at the end.

I am using Maya 2013 / VRay 2.4 / Nuke 6.3. The reason I have mentioned this is earlier versions of VRay do not write out the same EXR metadata to all render elements, something that is useful later on.

In VRay, I can write information out with the EXR metadata via the Render Settings window, under Image Format Options:



Anything entered in the format " attribute01=value01;attribute02=value02 " will be written into the EXR metadata, and can be double checked using a ViewMetaData node:




Writing these values into the window every time is inefficient, so a better way is to have Pre Render MEL do the job for us:
Now, using the VRay Frame Buffer, I can save out the exr to be read in Nuke.
However, we are now missing the individual lightSelects for each light - without these, we can't reassemble the render in Nuke. Luckily, we can use the following python script:

While not the most efficient code, this will take each light and make a diffuse and specular component and name them appropriately and sensibly.

Now we are ready to save out the exr, and move into Nuke.

No comments:

Post a Comment