r/vtubertech • • 4d ago

Spring bones overwrite your retargeted animation: getting an authored tail onto a VRM

Long-ish, but the fix is small and it took me an embarrassing amount of time to find, so here it is. Disclosure up front: this is my own character and her stream, not a tutorial I read.

Setup: I animate in Blender on her own rig, then retarget each clip to the VRM she actually streams with (three-vrm, in a browser stage). Body clips come across fine — each animated bone gets moved into the VRM's axis convention with a per-bone correction taken from the two rest poses: V_local = D_parent⁻¹ · source_local · D_bone, with D_bone = L_rest⁻¹ · D_parent · K_rest. At rest and at every sampled frame the result matches the source skeleton within 0.4 mm, so the conversion itself was never the problem.

Two things broke the tail specifically.

  1. A VRMA only carries humanoid bones. Anything secondary — tail, ears, hair — isn't in VRMC_vrm_animation.humanBones, so it isn't in the file at all, and nothing warns you. I kept the tail joints as plain extra nodes with their own rotation tracks alongside the humanoid ones. three-vrm's VRMAnimation ignores them, which is correct behaviour; the raw glTF animation still has the tracks, so you build a second THREE.AnimationClip from those and run it on the same mixer as a sibling action.
  2. Once the track existed the tail still didn't move, and this is the bit worth knowing: the spring-bone solver runs after the mixer, every frame, and it overwrites the rotations of every joint that has a VRMC_springBone entry. Anything you write before vrm.update() is discarded — including a perfectly good keyframed pose. You have to write it after:
  • sample the clip immediately after mixer.update(),
  • let vrm.update() run the solver,
  • then re-apply the sampled local rotations to those joints,
  • and call the spring-bone rebuild for each one, because spring-bone bones normally have matrixAutoUpdate off and your quaternion write never reaches the world matrix otherwise.

Then switch your procedural tail off while the clip is playing, or the two fight each other and you get neither.

Result: her six-second loop now swings the tail about 1.4 m tip to tip, authored, and the same clip still runs the hair and ears on springs so they respond to the motion instead of being frozen.

If you're retargeting Mixamo/Blender clips onto a VRM with a tail, that ordering issue is almost certainly why your keys look like they were ignored. Happy to go into more detail if it's useful to anyone.

11 Upvotes

8 comments sorted by

4

u/drbomb 4d ago

Man I'm sure it is like something amazing and very technical but I just read a bunch of nothing.

In unity springbones refuse to be animated so I use DynamicBones when animations are needed.

0

u/MaraXMelonie 4d ago

Fair, that's on me for burying the point. Short version: the spring-bone solver runs after the animation every frame and overwrites those joints, so the keys aren't ignored, they're painted over. Order has to be animate, then simulate, then write your rotations back, then force the matrix update (spring joints usually have matrixAutoUpdate off, so the write never reaches the world matrix).

On Unity I haven't tested it, but if VRM spring bones evaluate after the Animator there, DynamicBones is the same trade-off: it simulates late and writes over the joints too. The equivalent move is zeroing its weight (or disabling the component) on the joints your clip drives, same as switching my procedural tail off while the clip plays. Keyframes alone won't survive a simulation either way.

2

u/drbomb 4d ago

I... Still don't understand. What does execution order had to do with this? Where are you even running this that you can have such granular control of execution? It isn't Warudo or VSF.

Regarding DynamicBones. For simple tail wags, animating the root bone of the chain will result in the rest of the chain still getting simulated and the wag working as expected. Of course if you need a very specific kind of animation it would make sense to disable the script as needed 

0

u/MaraXMelonie 4d ago

Sorry, I skipped the most important bit in the first post: where. Not Warudo or VSF. She's a VRM drawn by three-vrm in a browser page I wrote myself, so the loop is mine and I decide what happens first each frame. That's the only reason I can control the order at all.

In three-vrm the spring physics isn't automatic. It's a function I call once a frame, and that call moves the tail bones. So if I set the tail pose and then run the physics, the physics is what gets drawn and my pose never shows up, which looks exactly like the keys being ignored. If I run the physics first and set the pose after, the pose wins. That's all "execution order" means here: whichever one runs last is the one you see.

Your DynamicBones example is the same thing from the other end, and I think we agree more than it looks. Wagging the root works because the visible motion is the simulation, you're steering it rather than authoring it. I was trying to dictate the shape of the whole chain, which is the one thing a simulation replaces. So yes, disable it when you need a specific animation. That's the same move as me switching the procedural tail off while a clip plays.

If it's still muddy I can paste the actual loop, it's about twenty lines.

2

u/drbomb 4d ago

...right. Ok. I'm good thank you.

0

u/MaraXMelonie 4d ago

Brother. You are using a completely different system to me. Sorry the technical explanation was not what you are looking for. I have clearly stated in the post and in a comment to you that it is a custom Three-VRM stage that I built myself. The part you are not getting is the procedural code part. All of the motion in the hair, ears, tail, are all influenced by physics, which overwrite key frames. My solution was simply to procedurally add the key frames AFTER the physics motion is applied to the springs. Simple as. 

2

u/drbomb 4d ago

I just said I'm good. Have a nice evening

0

u/MaraXMelonie 4d ago

Good luck on your model! I hope you do get it figured out and I apologize I was not helpful. <3