MayaMan Help Contents

Object Archiving

Object archiving allows you to manually output Renderman ReadArchives for any models or hierarchies of models of your choice, then replace the geometry in the scene with a "lightweight" version to improve interactive performance, but use the geometry in the archived RIB when rendering. Extensive use of object archiving can also greatly improve rib generation times.

Workflow: How to use object archiving in MayaMan

Select any single geometry node in the scene and select "Generate Archive RIBs..." from the MayaMan Menu. A dialog will appear, prompting you for a name and location for the archive. Select "GO!" to to generate the Archive.

The archive will have been generated to the specified location. Now, create a new object (eg a plain sphere) in the scene, and attach MayaMan Model Attributes to it. Open the Attribute Editor for the object and change to the MayaMan Attributes tab. In the "ReadArchive" section, enable "Substitute RIB". and browse to the location where the archive RIB on disk.

Illuminate the archive, in the MayaMan Attributes panel open the "Shading Attributes" section and turn on "Additional Light Set". Click the checkerboard icon to associate the default light set or enter the name of an existing light set. This step is necessary as archives are usually imported by transform nodes and maya doesn't illuminate transform nodes.

Done! If you do a MayaMan Preview render, you should see that the sphere will have been replaced with the archived geometry. Now, try scaling/moving the sphere and do another render. You should see that the archive geometry will be transformed accordingly.

Note: The second step, ie the replacing of geometry, can be automated using the Substitute RIB automatically option. Read more below.

Using Sequences Of Archives

When you create a sequence of archives and substitute the rib automatically MayaMan assumes the simplest mapping of input frame number to archive possible... it uses the #f notation in the rib name to insert the frame number into the rib name so my_archive.#f.rib will read my_archive.1.rib on frame 1, my_archive.2.rib on frame 2 and so on.

An alternative is to use the per-frame mel-script execution to change the archive string on the fly:

        setAttr -type "string" MayaManAttributes1.mmma_ReadArchiveFilename ("fly." + (($(FRAME)%3)+1) + ".rib");
In this case mayaman will turn $(FRAME) into the current frame number before mel gets the command so the mathematical expression (($(FRAME)%3)+1) will cycle between 1 and 3, the result will be:
        on frames 0,3,6,...           fly.1.rib
        on frames 1,4,7,...           fly.2.rib
        on frames 2,5,8,...           fly.3.rib
The user can use mel to create an arbitrarily complex mapping of frame numbers to archive names.

Limitations

Object archiving will only work if you have a single object selected when generating the archive RIB. However, this single object may exist in a hierarchy and may be a parent. This allows you to generate archive RIBs for parts of- or entire trees and/or groups (the group node is effectively a single parent of the members in the group).

Parameters

Output Directory

This is where the archive RIB and supporting files will be written to.

Archive Base Name

The base name of the archive RIB.

Flat Rib

This option will cause all selected geometry to be included in a single RIB file when generating the archive RIB.

Ignore Base Transform

When this option is enabled, the transformation on the selected node will not be put into the archive RIB. This option is especially useful when you archive an object/subtree/tree and then replace that object/subtree/tree with the archived RIB. The archived RIB will adopt the transformation of the object it replaces, which causes it to render identically to the replaced geometry. If we were not ignoring the base transformation in this case, then these transformations would effectively be applied twice.

Ignore Material

If this flag is enabled, then the archive RIB will end up using the material of the object that it is replacing in the scene, instead of it's own material.

Also Create Shadow RIB

If this flag is enabled, then MayaMan will also create a version of the RIB which is optimized for use in shadow runs. Later, when MayaMan is create a shadow rib, it will look for and automatically use the shadow rib if it exists and is newer than the main archive rib.

Substitute RIB Automatically

If enabled, MayaMan will automatically add a Model Attributes Node to the selected object, and enable Substitute RIB in the
ReadArchive section, and enter the path to the archived RIB.

Note: when this feature is enabled, "Ignore Base Transform" will be automatically enabled too.

Selection

This option determines whether only the selected model, or the selected model and all of its children will be included in the archive RIB. Note that groups are effectively just a transform node that has all group members as its children.

Start/End

These options determine which frames to generate the archive RIBs for.

Note on frame range in conjunction with the "Substitute RIB Automatically" option: If you generate an archive RIB for a single frame, then that archived RIB will be used for all rendered frames. However, care must be taken when generating archived RIBs for multiple frames to ensure that you have generated archived RIBs for all frames that will be rendered (in which the archived geometry will be visible). See Using Sequences Of Archives.

MayaMan Help Contents