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.

### Per Shape Archiving

The Per-Shape object archiving mode has been greatly expanded and enhanced including the ability to make fairly arbitrary material re-assignments at render time. To use this mode chose the 'Create An Archive Per Shape Node' option... this will cause all unimportant parts of the GUI do become disabled. Note, this will result in a MayamanAttribute node being created for every shape node to be processed. No shaders are created during this form of archive creation, just very simple rib fragments.

Generally the sets/stages are locked down before animation and they are typically comprised of static geo. To accelerate rendering previews during animation you may wish to archive just the constant geo by turning off 'Do Varying Shapes'. Likewise, during animation you may want to export and re-export non-constant geo several times but there is no point in re-archiving the constant shapes, during this phase you may wish to turn off 'Do Constant Shapes'.

The archive names created are not a literal rib name, archives created this way will have an '@' symbol prefixed and this is used as a flag to the subsequent rib generation that this archive should be handled a special way. Do not remove the @ symbol or the substitution may not happen properly.

For models that use more than one material, the archive name is decorated with information that maps material indices to model segments. Do not modify the [#,#,#] that may appear at the end of the archive name.

### 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. Note, if the final material requires U/V information then the material on the object at the time of archiving must also require U/V information. Even though the material is being ignored, mayaman will use the material's requirements to decide if U/V information should be stored or not.

#### 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.

#### Create An Archive Per Shape Node

Selecting this option causes an archive to be created for each shape node. This mode is recommended when the primary objective is to save rib-gen time without compromising your ability to move parts around... it is recommended that this be used in conjunction with Ignore Material and Flat Rib modes. Pruing mode with automatically be assumed to be 'Model'. A single node should be selected and the hierarchy will be traversed looking for models. The 'basename' parameter is ignored, node names are used.

#### ReAttach

If archives have already been created and you just want mayaman to create the attributes nodes and fill them in then turn on ReAttach (only available if Substitute RIB Automatically is on). The ribgen will be skipped.

#### Auto Proxy Poly Reduction

If not set to 0 then as each mesh model is archived it has a polyReduce applied and then this polyReduce and it's input are deleted which only leaves the proxy.

#### 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