Use Alembic to Render a Bullet Simulation

 
 
 

This workflow demonstrates how to export a Bullet simulation to an Alembic cache. 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 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 a 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.

The workflow is broken into two parts:

Exporting the Simulation to a Cache File

In this part of the workflow, we start with a Samurai scene that includes lighting and cameras which use a Rigid Set simulation of 1000 objects falling from the sky and colliding with the Samurai model. 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 Alembic lets you scale so you are not simulating and driving the actual objects.

The Rigid sets used in the simulation are standard primitive shapes (for example, boxes and spheres or hulls,) that will not transfer their materials or textures from their original geometries. The scene used in this workflow is a model of a Samurai Dojo. (Samurai Dojo model courtesy of AMD)

  1. Start out with a layout scene that has the basic geometry. In the bulletRigidBodyShape Attribute Editor Rigid Body Properties, set the Dojo model Body Type to Static Body and the Collision Filter to Static Mesh This creates the Samurai Dojo model as a static mesh, so it becomes a static collision volume.
  2. Increase the Internal frame rate (Attribute Editor: Internal Fixed Frame Rate) to 120Hz to create a better collision.
  3. Activate Debug Draw in the Attribute Editor so you can view the model better.
  4. Select the falling blocks and select Bullet > Create Rigid Set to turn the falling blocks into a Rigid Set. The blocks turn grey as the materials haven't been transferred.
  5. Further streamline the size of your simulation scene by hiding the original mesh, the source geometry (Display > Hide Geometry > All). Make sure to activate Debug Draw so you can see the model.
  6. Press Play to view the simulation. Tweak the physics settings if necessary.
  7. Once the simulation is ready, we have to transfer the animation onto the original geometry that has the material and textures.

  8. Select Bullet > Export Simulation > Export All to export the simulation to an Alembic cache.
    Note It is essential that you add .abc' after your file name when exporting, otherwise the export will fail.
    Note The Bullet > Export Simulation menu supports exporting the entire scene or only specific objects with Rigid Bodies or specific solved states.
  9. In the Alembic Export window, activate the Time Setting. Scroll down and activate World Space.
  10. Click Export Selection. The simulation exports.

    The Alembic cache file contains a flat list of all animated objects with their animation in world space. The cache file contains only the animation, no mesh or material information.

A cache file is created that the first team can send to the second team to view the simulation. The Import/Merge process is described in the next part of this workflow: Importing and Merging the Cache File.

Cache Notes

  • Only export with World Space animation is supported.
  • Larger scenes take a while. If this is your case, run the simulation in Batch. See Batch render a still or animation.
  • If there are objects that rotate wildly enable Euler Filtering to ensure continuous rotation.

Importing and Merging 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.

  1. Go to the lighting file where you have the lights and camera shots set up. All the original geometry is there.
  2. Select Pipeline Cache > Alembic Cache > Import Alembic > .
  3. In the Alembic Import window, select Merge. This merges the Alembic Cache with your current scene which lets you reconnect the animate transforms in the Alembic file.
    NoteYou can view the frame rate in the lower right corner of the Viewport.
  4. Press Play. The original geometries drive the Alembic animation.
    NoteOnce you have your scene, you can submit it for rendering or generate a playblast.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License