RfM
Exporting Pre-baked RIB's


return to main index



Introduction

Exporting a model from Maya as a pre-baked RIB (refer to the tutorial "Rib: Pre-baked RIBs") can lead to unexpected results unless care is taken to ensure the model:

  1. is located relative to the origin of the world coordinate system,
  2. its transforms have been applied (refer to the tutorial "Maya: Freeze Transforms"), and
  3. its bounding box is of known dimensions.

1. Positioning a model prior to exporting determines, among other things, how it will rotate when it is assigned to a proxy object in another scene.
2. Using Maya's "Freeze Transforms" command ensures that it will accurately replace the proxy object to which the pre-baked rib will later be assigned.
3. Checking a models bounding box before baking ensures it is of the required dimensions.


Step 1

The model shown in figure 1 is approximately spherical and, as such, it has been moved to the center of Maya's modeling plane so that it will rotate around its "center of mass". Before continuing with it is very important to select the model to be baked via the outliner - figure 1.

In the script window the MEL commands makeIdentity and xform can be used to freeze the models transformations and report the size of its bounding box. By uniformly adjusting the scaleX, scaleY and scaleZ values of the group node and re-applying the MEL commands the model can be adjusted until it conforms to the required size.

The values reported by the xform -q -bb command represent the minX, minY, minZ and maxX, maxY and maxZ dimensions of the model's bounding box.


maya_prebake
Figure 1


Step 2

Ensure the RenderMan for Maya plugin has been loaded - figure 2.



Figure 2


Use the Export Selection... menu, figure 3, to open the Export Selection Options dialog box - figure 4.



Figure 3


Unless the reader is exporting a lighting rig it is best to "switch on" the Enclose in Attribute Block item. In general, the model should be exported (baked) as a RIB file in the current project's RIB_Archive directory. If this directory does not exist it should be created manually - note the use of upper and lower case letters in the name of this directory.



Figure 4



Step 3

Pre-baked RIBs exported from RenderMan for Maya, by default, have their specular and diffuse attributes set to zero ie. "off". If the exported model is to be shaded with a ray traced occlusion shader it will be necessary either to assign a Diffuse Visibility attribute to the model prior to exporting or edit the RIB file after exportation. For example, the visibility flags for specualar and diffuse rays (shown in red) have been edited in the snippet of (pre-baked) RIB shown below.


version 3.04
ScopedCoordinateSystem "world_ref"
AttributeBegin 
    AttributeBegin 
        Attribute "identifier" "string name" ["nurbsSphere1"]
        ConcatTransform [ 1 0 0 0  0 1 0 0  0 0 1 0  0 0 0 1 ]
        AttributeBegin 
            AttributeBegin 
                Attribute "identifier" "string name" ["nurbsSphereShape1"]
                Sides 2
                ShadingInterpolation "smooth"
                Attribute "user" "int receivesShadows" [1]
                Attribute "visibility" "int camera" [1] "int specular" [1] "int diffuse" [1]
                TransformBegin 



© 2002- Malcolm Kesson. All rights reserved.