MTOR
P r e - b a k e d    R I B ' s


return to main index


links
cutter pre-baked ribs
freeze transforms



i n t r o d u c t i o n
Exporting a model from Maya as a pre-baked RIB (an archive file) 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 (Freeze Transforms), and
  3. its bounding box is of a specified dimension.

1. Positioning a model prior to baking it determines, amongst other things, how it will rotate when it replaces 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 "attached".

3. Checking a models bounding box before baking ensures it is the size you are told it should be!



s t e p    1
The model shown in figure 1 is spherical and as such it has been moved to the center of Maya's modeling plane so that it will rotate around its geometric center. It is very important the models group node is selected in the outliner window for steps 1, 2 and 4.

In the script window the MEL commands makeIdentity and xform apply the models transformations (ie. Freeze Transforms) and report the size of its bounding box. By repeately adjusting the scaleX, scaleY and scaleZ values of the group node and re-applying the MEL commands you can see that the model has achieved a bounding box dimenison that indicates it will later fit with reasonable accuracey into a proxy cube 1 unit wide, 1 unit high and 1 unit deep.

The size values generated by the xform command represent the minX, minY, minZ, maxX, maxY and maxZ coordinates of the models bounding box.

maya_prebake

figure 1



s t e p    2
After loading the mtor plugin a new palette was created to which a (RIB) Archiver was added - figure 2. The Archive Contents were set to output only the geometry of the model.

s t e p    3
Next the Workspace Manager was opened to see where the pre-baked RIB (aka archive) will be saved - figure 3.

In step 5 the path to this location will be used to reference the archive RIB file.


workspace

figure 3




archiver

figure 2



s t e p    4
Next the archiver was attached to the model - figure 4, and the scene was rendered. The image produced by the renderer is of no consequence, its the pre-baked RIB file thats important.

Look in the Workspace Manager->toRibs directory to check for the existance of the archive RIB file. It will be named something like, "untitled.group1.0001.rib". Rename the file if you wish but do not include spaces in the file name.



attach

figure 4



s t e p    5
Either in the current scene or a new scene create a 1 x 1 x 1 poly cube - this is the proxy object that will be substitued by the imported pre-baked RIB.

If you use the current scene ensure the archiver is detached from the model and the model is made invisible. Next, add a RIBBox to the palette - figure 5.

Double click on the RIBBox and use the Edit button to open a text window. Insert the following RIB statements and save and close the text window.

    ReadArchive "PATH/TO/YOUR/PREBAKED_RIB"
    Opacity 0 0 0

The text shown in red must conform to the full path of your archive RIB file. Always use forward slashes as separators.



attach

figure 5



s t e p    6
Attach the RIBBox to the cube as well as a surface shader such as plastic. If you choose the plastic shader make sure you use Import Appearance not Create Appearance. Add a distant light to the scene.

Render the scene. The original object should appear in place of the cube. Create a 1000 cubes (only kidding) and attach the RIBBox to all of them. Re-render the scene!





© 2002-5 Malcolm Kesson. All rights reserved.