/
Adding clip cloth - Houdini

Adding clip cloth - Houdini

“Clip cloth” is a new cloth cache generation method introduced in Atoms 7.

It consists of generating a database of cloth simulations per animation clip; the clip cloth cache generator tool can then use this database and the anim state metadata on each agent to automatically generate a cloth cache from your simulation without simulating all the agents with nCloth.

The cloth simulations in this database are stored in root space. This allows Atoms to easily apply and merge them to the final simulation.

Generate the clip cloth database

As mentioned before, we need a database of cloth simulations per clip.

Create a new scene, initialize the Atoms scene with your agent type, and load the variation table.

Now we need to generate the clip cloth caches for each clip and variations.

From the Atoms->Exporter menu, open the “Clip cloth exporter”:

image-20250304-095431.png
image-20241014-165219.png

This tool is similar to the cfx exporter. You can build, build & export, or export the scene/cache.

In the “Variations” section, you can choose an external variations file or use the variations from the scene.

In the “Animation“ section, you can choose which animation clip to use to generate the clip cloth cache.

In the “Geometries” section, you first need to choose the agent type. Then, you can choose a specific variation, or you can manually choose which geometries to use to build the scene and export the clip cloth cache.

Then, in the “Option“ tab, you can choose the preroll frame length; in the “Output” tab, you need to set a folder containing the database of clip cloth caches. The merge option is used if you want to merge the new clip cloth cache you will generate with one that already exists on your disk. For example, imagine you have two or three variations with different cloth geometries. You need to build and export each clip cloth per animation for each variation, and in this case, you need the merge option since they must be stored in the same clip cloth cache.

The “Enable loop blend” blends some of the frames at the end of the animation loop with some frames at the beginning, but instead of blending poses, it blends cloth cache frames.

When you run the build process, the tool creates the skeleton and meshes of the agent type/variation you selected as Houdini assets. It then imports the animation and generates an OUT node. This node contains the atoms cloth exporter node that will be used by the export mode to generate the clip cloth cache. You need to apply your cloth setup before this node.

image-20250304-100946.png

If a geometry interacts with the legs, keep the skin cluster deformed when you generate the agent type variations table. This is needed if, in your simulation, you are using ground adaptation or foot locking. When Atoms generates the final cloth cache for an agent, it first merges the cloth cache frames of all active animation on the agent in root space, then converts the cache in word space. However, the agent’s final pose could differ from the input animation pose due to ground adaptation or foot locking, so a skin deformation must be applied. For this reason, a skin deformer is necessary before the cloth is set on the geometries affected by the leg joints.

Generate the final cloth cache

Create an agent group with a grid layout, state machine and variation module.

image-20250304-100336.png

Select the state machine module, and in the “Metadata section” activate the “Write anim state metadata” option.

image-20250304-100210.png

This writes on each agent the anim state metadata. This metadata contains information about the current clips and states active, with clip name, current frame and blend weight of each active clip. With this information and the database of clip cloth caches, the “clip cloth cache exporter” is able to generate a final cloth cache from the simulation.

Open the “Clip cloth cache exporter” from the Atoms menu:

 

image-20250304-100420.png
image-20250304-100519.png

 

Add the agent group to the export list. Set a path where the cache is going to be saved in the “Cache path” widget, choose the path where we stored the clip cloth caches we generated in the “Clip cloth path” widget and then press “Add” button. You can pass multiple clip cloth paths, so if you have multiple clip cloth databases/path you can specify them here.

At this point press the “Export” button and the tool generates the final cloth cache.

To check the result:

  • export first an atoms cache

  • create an atoms proxy node

  • load the atoms cache on the proxy node

  • load the cloth cache the “Clip cloth cache exporter” has generated

Related content

Copyright © 2017, Toolchefs LTD.