emilianavt / VSeeFaceSDK

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

VSF Animations For Toggling Expressions ON and OFF #11

Closed VinTechage closed 2 years ago

VinTechage commented 2 years ago

I've been using animation clips for expressions in VSeeFace, and I notice an interesting limitation. The animation clip for an expression only plays when you toggle said expression ON, and not when OFF. I have a client who wants to have a prop extend in and out at the same speed. The problem is that the prop retracts faster than it extends. This issue is due to the animation clip only playing when the expression is toggled ON. I could increase the transition speed of the expression to slow down the retraction of the prop. However, that will also slow down the extension of the prop. I would like to see the VSF_Animations script to have a slot for both a Toggle On and Toggle Off animation clip to play.

I know that this may not seem a critical issue with VSeeFace. Yet, my client and I would greatly appreciate if this feature was added to a future update of VSeeFace.

emilianavt commented 2 years ago

Actually, the animation is theoretically playing all the time, but the weight of the animation is 0. When toggled on, the weight is increased from 0 to 1 during the transition time and from 1 to 0 when it is toggled off again. An animation that simply has the prop at fully extended should the extension and retraction occur at the same speeds, both determined by the transition time.

If the extension and retraction process should be fully handled by the animation, I would recommend adding a custom animator to the prop and setting a bool parameter on it with a combination of the VSF_Trigger, VSF_Toggle and VSF_SetAnimatorBool components.

VinTechage commented 2 years ago

Makes sense. I found a video tutorial on animation chains for VSeeFace. This has solved my issue.

emilianavt commented 2 years ago

Great, I'm glad it' solved!