Example: Swapping arms on a robot (Advanced Assets only)

 
 
 

This example shows you how to use assets, file referencing, the Transfer Attribute Values option, and the Publish Child Anchor option to swap between different arms on a robot model.

Note

Although this example focuses on how to accomplish this with Advanced Assets, you can also accomplish this with Assets with Transforms without any node publishing.

Consider a robot model composed of various body parts referenced from other files (for more information on referencing an asset, see Assets and file referencing). Each of these body parts are encapsulated by an asset with appropriate published attributes.

Suppose for a new animation, the robot must lift a heavy crate. However, these arms are too small for the animation.

If you open the referenced arm file, you can see the original arm is encapsulated by L_RobotArm_AST. You can model a second, more powerful arm here.

To create a second arm

  1. Select Assets > Advanced Assets > Create > .

    The Create Advanced Asset Options window appears.

  2. Name the asset L_PowerArm_AST.
  3. Click Apply and Close.
  4. Select Assets > Advanced Assets > Set Current Asset and select L_PowerArm_AST.
  5. Model the new arm.

    All the new arm geometry is automatically created under the L_PowerArm_AST node.

  6. Publish the appropriate attributes and nodes with the same names as their corresponding attributes and nodes on the L_RobotArm_AST.
  7. When finished, select Assets > Advanced Assets > Set Current Asset and select None.

You now have two assets, each encapsulating one arm. However, if you use the Transfer Attribute Values option to switch the arm referenced by the main robot file, you get the following result.

The arms appear on top of one another and are not translated properly. If you take a closer look at the hierarchy, you can see that the referenced arms are no longer located correctly in the character’s hierarchy (they are missing from underneath their respective groups). This is because the main robot scene no longer recognizes any of the nodes under the asset (for more information see Published nodes).

In order to swap the arms correctly, you must first publish the new arm as a child before you transfer its attributes.

To swap the robot’s arms

  1. In the arm file, select the node L_powerArm_GRP. This group is located just under the L_powerArm_CNT node and is a grouping of all the geometry composing the new arm.
  2. Select Assets > Advanced Assets > Node Publishing > Publish Child Anchor.
  3. Select L_robotArm_AST, then + select L_powerArm_AST.
  4. Select Edit > Transfer Attribute Values > .

    The Transfer Attribute Values Options window appears.

  5. Turn Values on.
  6. Set In connections to Transfer from source.
  7. Set Relationships to Transfer parent/child relationships.
  8. Set Rename to Rename target asset.
  9. Click Apply and Close.
  10. Hide the display layer corresponding to the old robot arm.
  11. Save the file.

The new arm is organized under the asset L_robotArm_AST while the old arm is organized under the asset L_robot_arm_ASTOrig.

Now if you open the main robot file, the robot’s arms are replaced with your new, more powerful looking arms. Since you published these arms as children in their source file, Maya knows they are part of a hierarchy and uses their node information, not their name, to determine their place in the hierarchy.

As long as the published attributes of your new arms match the published attributes of the old ones, any associated actions (such as animation) are transferred from the old arms to the new arms.