Example: Referencing and swapping a car in a scene
 
 
 

This example shows you how to use assets and file referencing together to quickly substitute objects in your scene without losing the behavior of the objects within it.

Consider a low polygon car referenced into a city scene, then scaled and animated.

In its source file, the car model is organized under a container named Car_CNT. The container’s published attributes include the car’s Translate and Rotate values as well as the spin of its wheels and the left and right turn of its front wheels. In the parent scene, the animation is achieved by modifying these published attributes. These are called reference edits and are stored in the parent (city) file.

You can view reference edits by selecting File > List Reference Edits from the Reference Editor.

Now consider a second car model that you want to replace the old car model. This new car resides in its own file.

The second model has a different structure and additional nodes compared to the original model for extra details such as the steering wheel, windows, side doors and trunk.

More importantly, this second model is organized under a container with the same name (Car_CNT) and the same published attributes as the original car. This is crucial since the reference edits of the parent file are stored by published names. Optionally, it may also have additional published attributes to control the state of the doors, windows, and other details not present on the old car.

You can now change the old car in the city scene by replacing the existing reference with a reference to the new car.

To replace the car being referenced by the city

  1. In the parent (city) file, select File > Reference Editor.

    The Reference Editor appears.

  2. In the Reference Editor, select the car reference.
  3. Select Reference > Replace Reference.

    A file browser appears.

  4. Select the file for your new car and click Reference.

The old car is replaced with the new car. If you playback the scene the new car follows the old car’s animation.

Since reference edits are stored in the parent scene according to the published names of a container, you can replace the car with any referenced container with the same name and published attributes. This allows you the flexibility to try different options in a scene without breaking it.

NoteThis example uses the Reference Editor and the Replace Reference command. However, you could also use the Transfer Attribute Values command to achieve the same result. To do this you would place both cars in the same file and transfer the attributes of the original car to the new car.