animancer
animancer copied to clipboard
Sample an animation clip and apply to an animancer layer?
I've run into this issue: https://forum.unity.com/threads/how-to-sample-pose-directly-from-an-animationclip.721160/
Basically what I need is Unity's AnimationClip.SampleAnimation, however applying the sampled data to a layer, not the whole gameObject, so that I can mix two samples.
The OP of that Unity forum thread said they eventually decided to use Animancer... which is great, but even with Animancer I still don't know how to do it.
The Playing in Edit Mode page explains how you can use EditModeSampleAnimation
for a single animation, so you'll need to make a method like that which takes multiple animations and sets them up in the layers you want.
The only way I know to use layer is like this:
animancer.Layers[index].Play(clip);
I know animancer.Layers[1].Play(clip);
actually work in edit mode, but it will cause the whole playable graph to be initialized and the that brings other issues... I'd just like to sample a frame, like EditModeSampleAnimation
or Unity's AnimationClip.SampleAnimation
, but mixed with layers (or at least with AvatarMask). I still can't figure out how to:
takes multiple animations and sets them up in the layers you want.
The method I was thinking of is actually EditModePlay
rather than EditModeSampleAnimation
.
but it will cause the whole playable graph to be initialized
Yeah, then you can just pause or destroy the graph after you evaluate it.