Rib
Pre-baked RIB's


return to main index

Link
freeze transforms



Introduction

Before attempting to produce a pre-baked RIB (ie. an archive) with Maya it is useful to gain an understanding of what such RIB files are and how they are referenced by another RIB document. This tutorial assumes you are using the Cutter text editor.


What is an archive?

An archive, or pre-baked, RIB is similiar to a "regular" file except that it does not contain any camera statements or the statements WorldBegin & WorldEnd. Often an archive also omits shading and lighting statements as well. Generally, archive files only contain the data relating to the geometry of an object. In Maya, using Pixar's plugin mtor, a model can be exported as an archive RIB file using a "Slim archiver appearance".


original

Figure 1 - original model

3

Figure 2 - archive read 3 times


For the purpose of this tutorial a regular RIB file has been converted into an archive as a result of removing all the text from the beginning of the RIB file down to the first occurance of the statement TransformBegin. The "tail" of the RIB file has also had its concluding WorldEnd statment removed. After inserting AttributeBegin at the head and AttributeEnd at the tail of the document we have effectively created an archive RIB file.

The original RIB and the converted archive can be viewed here and here. The RIB file [view here] that imports the archive does so using a ReadArchive statement.


Archive Rib File


AttributeBegin
    TransformBegin
        Rotate -90 1 0 0
        Cylinder 0.2 0 2 360
    TransformEnd
    TransformBegin
        Translate 0 2 0
        Rotate -90 1 0 0
        Cone 0.5 1 360
    TransformEnd
AttributeEnd

Although the archive (pre-baked) rib shown above is trivial, it does conform to the format of a correctly structured file. Apart from being much more complicated, archives generated by professional 3D applications such as Maya/RfM Pro or Houdini follow the same format. They also include commented text at the head of their archive files.


Rib File Using an Archive


Display "untitled" "framebuffer" "rgb"
Format 427 240 1
Projection "perspective" "fov" 40
ShadingRate 1
  
LightSource "distantlight" 1 "intensity" 1.5 
                    "from" [0 0 0] "to" [0 0 1]
  
Translate  0 -1 5
Rotate -30 1 0 0
Rotate 0   0 1 0
Scale 1 1 -1
  
WorldBegin
    Surface "plastic"
    TransformBegin
        Translate -1 0 0    
        ReadArchive "archive.rib"
    TransformEnd
    TransformBegin        
        Translate 0 0 0    
        ReadArchive "archive.rib"
    TransformEnd
    TransformBegin        
        Translate 1 0 0    
        ReadArchive "archive.rib"
    TransformEnd
WorldEnd







© 2002- Malcolm Kesson. All rights reserved.