- Modifié
Exporting connundrum
I'm attempting to export my animation into a sequence of images and have run into some particularities.
My animation is 220 frames long, but my cycle is actually only from frames 30-90.
There's no feature in the exporter to specify a range to export (which would be awesome), so it exports the whole animation. However it only exports 177 frames total instead of the expected 220.
Also if i go delete frames 0-29 and 90-177, the animation won't loop properly as expected either.
Any ideas what's going on?
I had a similar problem so maybe this will help. Add a key frame that matches some initial state (e.g. position) on first frame. If that throw off the tweening then put copy of that key at first frame where the animation "really" starts. Do same end of animation. That did the trick for me. Hope that helps.
Hrmm, still not having luck. It seems like no matter what i try it won't export properly.
Maybe its something to do with the frame rate?
what rate does spine playback in the editor at by default?
perhaps if i match that when i export.
Ok it looks like the trick is to export at 30fps
using a different frame rate won't allow you to easily find the start/end frames of your cycle if its within part of a larger cycle. you would need to create the cycle without any keys outside of the cycle range if you want to use a different frame rate.
Spine uses 30fps. This will be configurable soon.
Why don't you just animate your cycle from frame zero to the end of your cycle? Why have an animation where you only care about the middle part? Trying to understand your workflow to see if we need more export features.
The problem I was having was when i started offsetting body parts of the animation from the main key poses i had set in the cycle.
Lets say I have a breathing cycle and want to offset the head to trail slightly behind the rest of the body movement. If I'll try setting a key 3 or 4 frames in from the first one, and dip the head down a bit, and the raise it slightly a few frames after the middle keyframe.
What happens then though is that i can't line up the start and end keys to smoothly cycle the head after doing this. I've tried all different kinds of combonations of the curve editor, but there will still be a hiccup (and yes i've tried removing the duplicate last keyframe as well so that its not playing both the first / last keyframe twice.
Anywhoo, so the only way i've found to work around this hiccup, is to make the cycle from frames 30-90 lets say. Then to repeat the cycle once at the beginning and once at the end. Then offset the head, but change the looping playblack area to 30-90. This makes it so the head cycles perfectly. (there's just no actual key at 30 or 90 for the head).
And thus the only way to export it properly is to export the entire 120 frames, at 30fps and to delete frames 1-29 and 90-120.
i can try and make a video recording of the issue if its not clear how i described it.
I think I know what you mean. For example, you have an animation from 0 to 30. You want the head to loop offset from the rest of the animation. So you want the head to loop from 20 to 40, but you want your animation to remain 30 frames. The way to do this is to so the key at 40, move the timeline position to 30, and key that position. Now move your key from 40 to 10 (because this key is "sticking out" 10 frames beyond the 30 frames that you want for your animation). Finally, copy the key from 30 to 0. Does this achieve what you want?
This was used to do the stars in the powerup example project. I think Shiu will make a video showing the technique in detail.
I think i'm following, but doesn't that leave you with the same problem i described? By setting keys at 0 and 30 it screws up the transitioning tweened frames between the offset keys and thus doesn't cycle smoothly.
I'll take a look at the powerup example and see if i can understand the setup better.
A video tutorial would be awesome.
Doing it like I described, when you key frame 30 it will be the exact position you want your skeleton to be in, halfway between frame 20 and 40, and because you copy/paste frame 30 to 0, it should loop perfectly.
A little tip when looping, if you scrub the timeline by starting the drag inside the last frame, scrubbing will loop when you go past the last frame. This lets you scrub the looping portion of an animation, which otherwise would be awkward. If you click or start the drag past the last frame, this won't happen.
The Spineboy walk and jump animations both have more than 30FPS... so this discussion thoroughly confuses me.
How does Spineboy's > 30FPS map into animation at 30FPS during gameplay?
And since the example code uses 60FPS, I'm not sure I understand what is supposed to happen...
I've seen posts about this in the forums but none of the explanations make sense to me. :wonder:
When you create animations it is useful to use a relatively coarse number of frames per second. Spine uses 30 by default (and this can't be changed, yet). When the animation is played as a skeletal animation, it uses interpolation so it can be drawn at any position smoothly, so there is effectively no frames per second limitation. If the animation is exported as images, it can be useful to match the frames per second used in the editor to that of the export. This ensures important frames are present in the export. Eg, a baseball hitting a bat could, without special care, easily export the frame before it hits the bat and the next frame after it hits the bat, when you probably want the export to have a frame where the ball is exactly hitting the bat.
A little tip when looping, if you scrub the timeline by starting the drag inside the last frame, scrubbing will loop when you go past the last frame. This lets you scrub the looping portion of an animation, which otherwise would be awkward. If you click or start the drag past the last frame, this won't happen.
I can't seem to make this cool little trick work. Clicking and dragging on a key moves the key. And positing the time marker on the last keyframe of the cycle loop area and dragging just scrubs normally.
Made a small video to show how you can offset your animation.
http://www.youtube.com/watch?v=-F9ci9c_j-k&feature=youtu.be
Hope it helps I'll be doing a whole bunch of these small videos during next week.
Thanks Shiu! The audio seems very quiet though. It's listenable but not ideal. :makeup:
I'll boost it. Had just woken up, just wanted to get it done quick. Will most likely be a completely new video in the series I start next week.