boboshu

Cinematic Sequencer with Spine support: p35143

the slate form spine with old spine (3.4) they mix 2 animation is ok
http://slate.paradoxnotion.com/forums/topic/spine-animation-track/

when i upgrade 3.6 the apply(mix) is not ok, please help.
public void UpdateClip(PlaySpineAnimationClip clip, float time, float previousTime, float weight){
if (spineComponent != null){
clip.clipAnimation.Apply(skeleton, 0, time, true, null, weight, Spine.MixPose.Current, Spine.MixDirection.In);
// clip.clipAnimation.Mix(skeleton, 0, time, true, null, weight);
}
}
http://slate.paradoxnotion.com/wp-content/uploads/sites/7/2018/03/SLATE_Spine.unitypackage
boboshu
Posts: 5

flashframe

@boboshu Did you ever resolve this problem? I'm trying to work out a solution too...

Does anyone else ever use the SkeletonAnimation.Apply method to apply an animation over time? Can't seem to work out how to get it to mix/blend between animations.

Any advice?

Thanks!
flashframe
Posts: 19

boboshu

flashframe wrote:@boboshu Did you ever resolve this problem? I'm trying to work out a solution too...

Does anyone else ever use the SkeletonAnimation.Apply method to apply an animation over time? Can't seem to work out how to get it to mix/blend between animations.

Any advice?

Thanks!
yes i solved .
here is my code.
public void UpdateClip(PlaySpineAnimationClip clip, float time, float previousTime, float weight){
if (spineComponent != null){
// baseWeight = activeClips == 2? 0 : 1 - weight;
// clip.clipAnimation.Apply(skeleton, 0, time, true, null, weight, Spine.MixPose.Current, Spine.MixDirection.In);
// clip.clipAnimation.Mix(skeleton, 0, time, true, null, weight);

//fix spine 3.6 mix bug 2018.9.16 //by boboshu
if( m_SkeletonAnimation == null)
m_SkeletonAnimation = spineComponent as SkeletonAnimation;

var toAnimation = clip.clipAnimation;

// Approximate what AnimationState might do at runtime.
if (activeClips > 1 && fromAnimation != null) {
skeleton.SetToSetupPose();
fromAnimation.Apply(skeleton, 0, fromtime, true, null, fromWeight, MixPose.Setup, MixDirection.Out);
toAnimation.Apply(skeleton, 0, time, true, null, weight, MixPose.Current, MixDirection.In);
}
else {
skeleton.SetToSetupPose();
toAnimation.PoseSkeleton(skeleton, time, true);
}

fromAnimation = clip.clipAnimation;
fromtime = time;
fromWeight = weight;

}
boboshu
Posts: 5


Return to Unity
cron