Maya Skies Internal Production Site

Home arrow Rendering arrow Maya to Radiance

Login






       

        Lost Password?
        No account yet? Register
Maya to Radiance Conversion PDF Print E-mail
Written by Administrator   
Sunday, 18 November 2007

maya2rad

Developed by Kenneth Ibrahim, 11/2007, Chichen Itza Hacienda Lab

Description

maya2rad is a simple MEL script that exports a suite of files for rendering with the Radiance renderer. The command is invoked within Maya by executing maya2rad in the Script Editor Window or from a shelf. There are currently no parameters to pass.

Functionality

Rendering in Radiance requires a number of files and a special control file is provided to streamline the rendering process. maya2rad makes use of this control file to centralize the rendering process.

Running maya2rad produces a file browser dialog allowing the user to choose the name and location of the master control file and then proceeds to parse the Maya scene and write out the following suite of Radiance files:

  • <name>.rif - master control file
  • <geo_name>.rad - defines geometry & related shader/texture (one for each piece of selected geo)
  • <name>_sky.rad - generates the sky and the sun using color, latlong and time values
  • <name>_cmds.txt - a text file listing additional commands to run at the shell
The user must select the pieces of geometry to write out before running the command. An error is produced if there is no valid geometry selected. Also no invisible object will be exported even if selected.

A separate maya2rad_template.ma Maya scene file is provided that should be imported into the scene to use with Radiance. It contains the following necessary objects:

  • RAD_template - a special shader that contains attributes necessary for Radiance
  • radRenderStats - an invisible locator that contains a set of rendering attributes
  • radSkyStats - an invisible locator that contains attributes used to define the sun & sky

Usage

These are the steps involved in using the script:
  • import maya2rad_template.ma into the scene to render in Radiance
  • assign an instance of the RAD_template shader to each object to render replacing any existing shader (this shader can be renamed as desired)
  • set the color or attach a file texture to the color channel of the shader
  • adjust the attributes in the "Extra Attributes" section of the shader as desired
  • adjust the attributes of the radRenderStats node
  • adjust the attributes of the radSkyStats node
  • run the maya2rad command
  • specify the name of the output master control file making sure to select "Radiance master scene file" in the "Save as type:" popup list

Check the Script Editor Window to see progress messages!

Details

General

Once the export is complete the user can read the <name>_cmds.txt file for commands and instructions on rendering in Radiance as follows.

First of all the 'rad' files produced reference geometry files that don't yet exist so the user must export each of the pieces of geometry in OBJ format from the "Export Selection" menu in Maya's "File" menu. Once the individual OBJ files are written out the obj2mesh command must be used to convert the geometry to the Radiance geometry format. Next, each image file used must also be converted to the Radiance hdr format using one of the image conversion commands starting with "ra_". The most appropriate command is automatically specified in the commands file based on the image's file extension. If no suitable "ra_" command can be determined then '??_???' is used indicating that the user will have to determine the best command. Please see the Radiance commands documentation for details. Finally, run the rad command with the master control 'rif' file as the only argument. This will process all of the rad files and produce a single '.oct' file which is fed to the rpict command to produce the final image. Changes can be made to any of the files in the set and the 'oct' file regenerated using the rad command to effect the changes in the render.

Shaders

The RAD_template shader should be used for all objects being rendered with Radiance. The color and any file textures should be assigned via the normal "Color" channel but all other shading parameters recognized by Radiance are accessed in the "Extra Attributes" section. No other attributes on the shader are used. Currently the "plastic", "metal", "trans" and "glass" shader types are supported via the Rad Shader Type parameter. The remaining attributes apply in different combinations based on the selected shader type. The Rad Modifier attribute should normally maintain the default value of "void" and the Rad Identifier attribute should be given a meaningful name related to the instance of the shader. For example, a shader set to "metal" might be given the identifier "darkTexturedMetal" or some other such description. Both the modifier and identifier keywords must not contain any spaces. Any attached file texture uses its node name as its identifier. These relationships can be seen in the resultant 'rad' files.

Auxiliary Nodes

The radRenderStats and radSkyStats nodes should be kept invisible. The radRenderStats node defines a number of parameters to the rpict command including resolution, exposure, coordinate system orientation, indirect lighting steps and quality levels. The radSkyStats node likewise defines parameters used to generate the sky and sun in the render. Please note that the latitude and longitude attributes are specified in degrees, minutes and seconds. These values are internally converted to decimal degrees. Please refer to the Radiance documentation for explanations of the rpict and gensky commands respectively.
Comments
Search
Only registered users can write comments!

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Saturday, 14 June 2008 )
 
< Prev   Next >