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.
- Select hip
- Shift + Select skirt control root
- Shift + Select skirt control tip
- 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.
- Ragdoll → Select → Markers
- 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.
- Select hip
- Select Marker, in Channel Box
- 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.
- Select all groups
- Ragdoll → Edit → Group
- Stiffness = 0.01
- 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.
- Select hip
- Shift + Select upper leg joint
- Shift + Selelect lower leg joint
- Ragdoll → Assign and Connect
- 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.
- Select main controller
- Ragdoll → Utilities → Warp Time Options
- 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!