avemon

Just wondering, is it possible to add/run spine animations using Unity's new timeline feature?

if not, are there any plans to support this?
avemon
Posts: 4

Pharan

Currently experimental. There's a big change coming up so I'd hold off using it for a week or something, if you can.

You can read about the current status here:
https://github.com/pharan/spine-unity-experimental/tree/spine-timeline/Assets/spine-unity-experimental/Spine%20Timeline/Documentation

Though you can play around with it if you want to download the experimental unitypackage.
http://esotericsoftware.com/files/runtimes/unity/spine-unity-experimental-spine-timeline-3_6-2017-11-25.unitypackage
User avatar
Pharan

Pharan
Posts: 5015

RemDust

:rock: This will be a very cool feature !
"I'm so exciiiiited !"
RemDust
Posts: 140

Dmitriy Makeyev

Tell me how soon will release timline?
Dmitriy Makeyev
Posts: 30

Pharan

It was added to the 3.6 branch on May 14.
You can try it now if you have that version.

Only the SpineAnimationState and SpineSkeletonFlip clip types are included for now since those are the types that act most predictably. (It just makes AnimationState calls to a target SkeletonAnimation's AnimationState, or flips the Skeleton)
We'll probably add a separate clip types soon for SkeletonGraphic since their types aren't reconcilable outside of sharing an interface, which currently isn't a supported property type by Unity editor.

Editor preview may not look exactly the same as at runtime, and backwards playback is not supported. We're hoping to improve things as we go though a lot of it depends on the type of exposed API Unity's Timeline and Playables feature has.
User avatar
Pharan

Pharan
Posts: 5015

bali33

Hello,

I was wondering if it would be possible to have multiple SpineAnimationTrack targeting the same SkeletonData ?

I tried (naively) to add a "trackIndex" property in the SpineAnimationStateBehaviour class and to use this trackIndex value inside the SpineAnimationStateMixerBehaviour class when animation is set :

line 83 : state.SetEmptyAnimation(clipData.trackIndex, mixDuration);
or
line 86 : Spine.TrackEntry trackEntry = state.SetAnimation(clipData.trackIndex, clipData.animationReference.Animation, clipData.loop);

Doing this does not work as expected. When clips overlaps their animation does not play.

Any idea how I could do this ? I have complexe spine, like a magical cauldron, in which I like to play multiple animations at the same time (tossing the liquid, bubble in the liquid, fire etc.) so it would be very useful.

Thanks

ps : when adding a SpineAnimationClip its duration in the timeline is not automatically set as the animation reference duration. Could be useful.

---

Ok, I have to apologize. It seems that it actually works in playmode, it's just from the Editor while scrubbing that it does not work. So nevermind the "request/question" part, but having the scrubbing working would be a must have :-)

Thanks
bali33
Posts: 91

Pharan

I could've sworn there was a trackIndex on that thing. In any case, we'll add it.

Your edits should have been correct but the preview might not have worked as expected. It should have worked fine at run time.

There are a lot of things in the Timeline interface that aren't exposed to us. I would have preferred it if it would do things like set the animation duration automatically, and things like the clip name as well. But it's currently not possible even in the latest Unity version.
If you spot another timeline-related plugin that's able to do this even in some hacky way, let us know. We might be able to apply the same logic.

edit:
I tried it just now. It works fine. But preview doesn't work correctly, as expected.
This is because each track's mixer behavior is blind to other tracks, so it can't combine poses from two different animations in preview. It's really a limitation of Unity's current implementation.
User avatar
Pharan

Pharan
Posts: 5015

bali33

Are you saying that you do have the "trackIndex" property ? I did updated my Spine C# and Spine Unity yesterday and I do not have this property.

Thanks

ps : a shame we can't make the preview working as expected. I hope Uinty will remove the limitation that are stopping you to make it works. Did you tried to contact them about that ?
bali33
Posts: 91

Pharan

Not yet. But we will add it in a future version.

I think It's not a matter of removing a limitation as it is working around the architecture they decided on. I don't think it'll be a small task on their part either way.
User avatar
Pharan

Pharan
Posts: 5015


Return to Unity