Caching agents to USD - Unreal

 

Exporting a cache

You can export a cache with the "Usd Cache Exporter" tool. 

 

Before you can export a cache you have to set up a level sequence. Create one from the viewport menu.

 

Then open the sequence into the sequencer and drag and drop the agent groups you want to export.

For each agent group add a new track for the "Static Frame" property.

Set two or more key frames making sure their value actually match the frame number they are on. Set the interpolation of all key frames to linear or the exported simulation won't look right.

 

Open the Atoms Cache Exporter via the Atoms Crowd Menu: Atoms Crowd > Usd Cache Exporter.

 

There are few options in the UI:

  • Level sequence: The level sequence to use to export the usd cache.

  • Export path: Usd output path. You can choose between Usd, Usda and Usdc file extensions.

  • Cache Start Frame: The simulation will start exporting only from this frame in the sequencer. The "Set Start Cache Frame" button will take the start frame of the sequencer range and set on the "Cache Start Frame" field

  • Start Sim Frame: The simulation won't start until this frame in the sequencer. The "Set Start Sim Frame" button will take the start frame of the sequencer range and set on the "Start Sim Frame" field

  • Texture resolutionX/Y: The tool tries to export also the materials attached to the skeletal mesh by baking the diffuse/specular/normal/reflection textures using this property as resolution.

  • Assets path: The exporter saves the skeleton animation for each agent inside the main usd file and then exports all the mesh/agent type/materials/variations in a folder called assets using a specific structure. You can reuse an existing assets folder passing its path to this property. In this way the tool will export only the animation data referencing the variations/mesh/skeleton/.. assets from this path.

Once all the fields are set you can click export.

 

Morph Targets

The exporter is able to export morph targets to usd blendshapes. The morph targets must exist on the skeletal mesh of the agent type or the atoms variation. To activate a morph target on an agent you need to add on the agent a double metadata called:

agent_type_name + _ + morph_target_name

For example if you have the agent type “man” and one of the skeletal mesh has a “eyeBlink” morph target you can add a double metadata in blue print or using the “add metadata beheviour“ component using “man_eyeBlink” as name.

 

 

 

If you want to drive a morph target using a clip you can add a curve on the anim sequence and use the morph target name as the curve name. During the simulation this curve is translated to a metadata and saved on the root joint metadata of the agent that is using that clip. Then the exporter is able to find those joint metadatas and translates them to usd blendshape weights.

 

Copyright © 2017, Toolchefs LTD.