• Editor
  • Export an animation with partial loop

  • Modificato
Related Discussions
...

Hi everyone,

I am stuck and have already searched but didn't manage to find a definitive answer on my problem.

Is it possible to export an animation with partial loop in it, without messing with runtimes, just from spine?

Example:
I have an animation that is 100 frames. It has an intro for 30 frames and I want it to loop between 30 - 100.
So it would play the intro once and then start looping.

I know I can make 2 separate animations but that seems to be a bit of a difficulty when I am delivering my animation to the programmer.

Thanks in advance for any kind of help!

Hello Kner, if you're delivering an animation to be looped at runtime, I'd go with two separate animations, the intro, and the looping part.
Why is there a difficulty exactly? What runtime are you using?

No I am not using any runtime, neither does the programmer. He just takes the json. files I export and import them in Unity.

I was just asked to find if there is a way that I can export it in a single json. file with one animation that would loop itself after the intro, so he wouldn't have to "code" the specific time that the animation would change. (Sorry If I am not making myself clear)

Hello, When you export for unity, no matter the number of animations you have inside a skeleton, you will still get one single Json per skeleton, together with the Png and Atlas files (or .atlas.txt since it's for unity)

Therefore you could still have two separate animations.

5 giorni dopo
Kner ha scritto

No I am not using any runtime, neither does the programmer. He just takes the json. files I export and import them in Unity.

Note that Unity doesn't know how to interpret Spine skeletal data in Spine's JSON or binary formats. Your programmer is almost certainly using our spine-unity runtime to load and render the Spine data.

There isn't a way to loop only a part of an animation without writing code to do so, sorry. If you split it into 2 animations, it is easy for the programmer to set the first one and queue the second to be played immediately afterward. The only downside is it may be harder for you to design the animations. You could have one animation that is the full animation (intro + looped part) so you can edit it easily, but uncheck export for that animation. Then you could copy/paste the keys from that animation (or duplicate it) to create the intro and looped animations, which do get exported.

As Erika said, each skeleton is exported as a single JSON file, no matter how many animations it has.

13 giorni dopo
Nate ha scritto

You could have one animation that is the full animation (intro + looped part) so you can edit it easily, but uncheck export for that animation. Then you could copy/paste the keys from that animation (or duplicate it) to create the intro and looped animations, which do get exported.

Thanks for replying! I am currently trying that but it is a bit of a trouble when there are a lot of rotating items that need to be synched perfectly from last "intro" frame to first "loop" frame.
Also would it be possible in the future of making a whole animation and choosing the exact frames you want to export?

Thanks again!

You can choose the frames to export for images/video, but not for data. Writing code to play only part of an animation is possible (you'd use TrackEntry animationStart and TrackEntry animationEnd). In the future we'd like to do something to make having a single animation with a start, repeat, and end parts.