holymolar

Hi Fellas,

Trying to figure out how to make a skeletonAnimation based Unity timeline looping clip. If the end of the timeline clip is shorter than the actual animation length, then it pops to the beginning of the animation.

Looking for the way so that an animation loops to seamlessly even if the timeline loop length doesn't match. This allows the animation clip to be changed more dynamically. In the example below, the idle is purposely longer than the Unity timeline looping clip. The objective for our custom timeline mixer loops the Spine animation instead of starting over.

Eventually, would like the timeline clip length to remain (making a custom mixer to do it). Putting in any number of different kinds of idles without having to bake a timeline per idle.

Quick Video
https://i.gyazo.com/93d7937ec1da4c12c8ab453be62a69a8.mp4

---

Introduced a class to keep track of clip loop differences as a hack/fix which seems to help with the skeletonAnimator mixer behavior. Allows to swap new animations in the mixer so the timeline clip doesn't have to adjust (very helpful for different kinds of idles).



Implemented in the mixer behavior:

...


Result:
https://i.gyazo.com/ad29386a790a02a0f728f48175bac430.mp4

Is there a better way of doing things?
holymolar
  • 記事: 16

Harald

Thanks for sharing your code. The end result looks very nice, nevertheless I wonder why you don't want to adjust the timeline length?

It seems as if you are recreating an animation playback engine with looping single-clip Timelines, instead of using functionality that has been designed for that purpose (the SkeletonAnimation with it's AnimationState and SkeletonMecanim). Is there something preventing you from using the normal animation workflow and forcing you to use Timeline instead?
アバター
Harald

Harri
  • 記事: 1514

holymolar

Harald さんが書きました:I wonder why you don't want to adjust the timeline length?
Is fine for a regular cutscene. skeletonAnimation, however, assumes that one knows exactly what animations are being used ahead of time.

And indeed attempting to used SkeletonMecanim in a timeline as in the thread Here, but doesn't seem to play/preview/scrub in editor mode. Essential for cinematic designers to make content vs. playing through a timeline to iterate on each adjust.

Our system decides at runtime how to "build" a timeline presentation heirarchy (data-driven) and how they coordinate with other tracks dynamically. Which sounds perfect for Mechanim to control the variables via timelines. Fabulous for situational overrides in the middle of a timeline. When the combat and cutscene timeline contains multiple actor party from a big inventory of usable characters, environments, audio, vfx, etc... tracks all customized by the context of the player's actions. 100s or 1000s of combinations to make every presentation option and override isn't viable.

The same character gameObject needs to be moveable from one timeline controller to another, and the various parts need to be scrub previewable in their content generation to align everything just so and bend into more timelines.
holymolar
  • 記事: 16

Harald

Thanks for the detailled writeup.
holymolar さんが書きました:skeletonAnimation, however, assumes that one knows exactly what animations are being used ahead of time.
I don't quite understand why skeletonAnimation assumes that, but no need to clarify that.
I see that your artist prefer working with Timelines to set up your attack/action sequences together with effects and other events, that totally makes sense and keeps the programming effort low.
アバター
Harald

Harri
  • 記事: 1514


Return to Unity