Render a Bullet simulation with Alembic

The following workflow shows how you can export a Bullet solve to an alembic cache file for import into a second, textured version of the scene to save time. You can use Alembic caches in Maya to transfer Bullet simulations between various stages of a production pipeline. The contents of Alembic cache files are evaluated as Maya geometry and can be modified with polygon, NURBS, and subdivision surface editing tools.

See About Alembic Caches for more information on how the Alembic caching system works.

Working this way is ideal for scenes that are going to be developed by other teams, such as Lighting or Camera artists where you can supply a lightweight version of the simulation to them so they can then add their elements before the final render.

This workflow is broken into two parts:
Note:

You can choose to export Rigid sets, objects with individual Rigid Bodies attached to them or everything in the scene. For this example, we will export the Rigid Set (Top of the mountain), so we choose Export selection to Alembic.

Click the CC button in the player controls to enable/disable the captions with the following video:

Exporting the Simulation to a Cache File

In this part of the workflow, we start with a wireframe verison of a rock face scene set up using Viewport 2.0 , that includes a mesh for the mountain base and a fractured rigid set for the top of the mountain. We are going to create an Alembic cache file of the Rigid body simulation hierarchy that can be sent to a second team, who are responsible for adding lighting and cameras. Using the Alembic workflow lets you can save time by not simulating and driving the actual objects.

To output the solve to an alembic cache file:

    Note: Currently, Bullet Alembic Export does not support workflows where the geometry has had scaling applied. Remove any scaling and/or local pivot from objects before attaching the Bullet Solver to the object.
  1. To set the scene up for export, turn off the Visibility option in the solved state node and switch the scene into Wireframe mode. You can turn on Bounding Box in the Bullet Solved Shape node for a very basic solver display.
  2. Press Play to view the simulation. Tweak the physics settings if necessary. Once the simulation is ready, we have to transfer the animation onto the original geometry that has the material and textures.
  3. Select either the Rigid Set or the mesh object.
  4. Select Bullet > Export Selection to Alembic. There are two choices: Export Selection to Alembic, which filters just the Bullet Rigid objects, and Export All to Alembic. In this workflow, choosing Export Selection to Alembic includes the Rigid Sets and all the rigid Shapes.
  5. The Export Selection window opens. You can choose to use the time slider, set start and end frames, or other time ranges.
  6. Scroll down to turn on the Strip Namespace option. If the scene has a namespace, it must be removed off when merging with the render scene.
  7. Choose HDF5 as your file format.
    Note: There is no Bullet support for Ogawa file format.
  8. Enter the exported file name and click Export Selected. The simulation runs as it is exported.
    Note: For even faster solving, run the solve in Batch. See Batch render a still or animation.

Importing the Cache File

In this part of the workflow, the lighting and camera team receives the exported Alembic cache file and merges it with their version of the scene that has lights and cameras. The second team's scene contains the same hierarchy as the team that created the solve, but with no animation.

To import the alembic cache into the render file:

  1. We load a static scene with the same hierarchy but this time with textures, materials, lights, and cameras.
    Note: The render scene hierarchy does not have a namespace. If there is a namespace on the file, you need to remove it beforehand if you want to bind it to the imported cache file, as Alembic does not support importing abc files into existing namespaces.
  2. Select Cache > Alembic Cache > Import Alembic > .
  3. In the Alembic Import window, select Import Under Current Selection and Merge. This takes the animation in the .abc file and connects it with the matching objects in the new hierarchy.
  4. Click Import. Click Play to view the solve in the rendered scene.
    Note: Once you have your scene, you can submit it for rendering or generate a playblast.