emilianavt / VSeeFaceSDK

The VSeeFace SDK for Unity is used to export models in the VSFAvatar format.
149 stars 10 forks source link

Animation disables dynamic bones #37

Closed MooshPaw closed 6 months ago

MooshPaw commented 1 year ago

I've had this very specific issue where my avatar won't get its dynamic bones to work when a certain animation is on the VSF_Animations component despite the animation not being active at any time. The animation causing this issue is the Sleepy one

image

To be more specific, the dynamics do work on the unity preview, as well as in VSeeFace during the transition between base and sleepy, however they don't work for tracking at any point, if i remove the components from the head on the sleepy animation, the dynamic bones do work, but it breaks my animation. If i put the keys again, the dynamics stop working

Here's a preview of the dynamics not working as well as how the animation looks Dynamics not Working image

And here's when the dynamics work and how the animation looks Dynamics Working image

emilianavt2 commented 1 year ago

Since the animation affects things even when it is not active, my best guess is that Unity's "Write Defaults" mechanics are causing some sort of issue. Perhaps the animation manipulates something that isn't touched by any other animation, causing Unity to set an incorrect default value?

MooshPaw commented 1 year ago

The animation does manipulate the head and neck, no other animation currently affects those Would there be any way to check the animator tree that VSF_Animation manipulates?

emilianavt2 commented 1 year ago

There isn't really any way to check it. VSeeFace builds a playable graph with the animations in the VSF_Animations components and sets each animation's weight according to the blendshape clip's value.

MooshPaw commented 6 months ago

Ok, I seem to have found the problem but it's very specific to the model and hella weird

The way the model works is that it has a humanoid rig with no weight, and the actual rig that is constrained to the humanoid one, so for movement I use humanoid head, that when moving, would also move the avatar's head

The dynamic bones that weren't moving were the parents of the head bone, in this case, neck

The fur was a children of neck alongside the head, and the constrains moved the head, but didn't move the neck, at least not directly, and caused the dynamic bones to not respond, as they are technically not being moved (I assume)

This was fixed by moving the fur from neck to head, so it would be a children of the head bone rather than the neck bone, and can get the constrain data to move the physics

emilianavt commented 6 months ago

Thank you for the update after figuring it out!