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:
Exporting the Simulation to a Cache File
Importing the Cache File
Note:
If the scene has a namespace, it must be removed before merging with the render scene. Use the Window > General > Namespace Editor to remove the Namespace before exporting.
You can generate playblasts using the VP2.0 off-screen, which lets you generate a playblast using mayabatch from the command line.
If your material comes in black, rewind the scene to update the materials.
When you create a rigid set, you can create it with an output mesh (to visualize the simulated result) in the Create Rigid Set options, or you can let Viewport 2.0 render the set (Visibility option in the solved state node) – you don’t need both. If you are using the legacy viewport, using the Output Mesh setting in the Create Rigid Set options, but this is unnecessary with Viewport 2.0.
Freeze scaling before you create a Bullet Rigid Set. Scale transform values are not correctly transferred to the resulting solved object .
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.
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.
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.
Select either the Rigid Set or the mesh object.
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.
The Export Selection window opens. You can choose to use the time slider, set start and end frames, or other time ranges.
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.
Choose HDF5 as your file format.
Note: There is no Bullet support for Ogawa file format.
Enter the exported file name and click Export Selected. The simulation runs as it is exported.
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:
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.
Select Cache > Alembic Cache > Import Alembic > .
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.
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.