Cloth on Stepped Keys

Hi all,

Here’s a mini-demonstration I’ve put together on how to run cloth on stepped keys, in the style of K-Pop Demon Hunters and basically all of Anime.

The rig we’ll be using is this one from Agora:

The the final result will look a little something like this.

Let’s go!

Setup

We’ll want the skirt attached to the hip, so we need our hip included in the simulation. But we don’t care to simulate the hip, so we’ll tell it to be “Animated” - making it follow along with whatever the animated hip is doing.

Basic Skirt

Next, we’ll assign Markers onto the skirt controllers.

  1. Select hip
  2. Shift + Select skirt control root
  3. Shift + Select skirt control tip
  4. Ragdoll → Assign and Connect

Repeat this for each of the controls.

Selection Set

In order to simplify selecting our Markers, I’ll put them all in a selection set.

  1. Ragdoll → Select → Markers
  2. Create → Sets → Set

No Collide

The skirt controls intersect the hip, we don’t care for collisions with the hip. We just wanted it to follow animation, such that our simulated skirt controls can follow along.

  1. Select hip
  2. Select Marker, in Channel Box
  3. Collide = Off

Stiffness

Defaults are a bit tense, so I put all cloth controls under a single group and tweaked the stiffness for each of them.

  1. Select all groups
  2. Ragdoll → Edit → Group
  3. Stiffness = 0.01
  4. Damping = 0.5

Legs

At this point, it’s quite clear the skirt will intersect the legs. So let’s include the legs in our simulation too, and set these to “Animated” as well.

  1. Select hip
  2. Shift + Select upper leg joint
  3. Shift + Selelect lower leg joint
  4. Ragdoll → Assign and Connect
  5. Behaviour = Animated

I picked the joints rather than the controls, because I’m animating both the IK and FK controls in this example and I want Markers following along the ground truth; the objects actually affecting the 3D model, which is typically the joints used to skin it.

Stepped Keys

Until now, we’ve been simulating every frame, even though the animation is animated on stepped keys. We can fix this by also simulating on stepped keys.

  1. Select main controller
  2. Ragdoll → Utilities → Warp Time Options
  3. Choose “Selection”

This will create a new animation curve used to drive the time of the simulation; advancing time only when a keyframe exists on the selected control.

Here’s how to do it using Python.

from ragdoll import commands
solver = cmdx.encode("rSolverShape")
transform = cmdx.encode("COG_CTRL")
commands.simulate_based_on(solver, transform)

Record

Finally, we’re ready to commit the simulation to keyframes.

Polish

Because there are so few controls, they sometimes fail to capture accurate contacts. For that, because the recorded keys are regular Maya keyframes, and because we now only have stepped keys where there were already keys, editing them is a breeze.

Final

And there you have it!

1 Like

One more tip.

Distance Constraint for Horizontal Connectivity

The “Assign and Connect” will link each select control to each other, keeping stretch from happening along its length. But it does not keep stretch from happening between its neighbours.

A distance constraint can keep cloth together horizontally, especially useful (necessary) on longer cloth. Not so much in this example.

1 Like

Another example by @nico_sainterose, thanks for sharing!


Cool, thanks for sharing!