[SOLVED] Animation Pausing After Loop

When I view my animation with the scene composer in loop mode, the animation will run once and then it pauses for a second or two before it loops. I thought it was just a mistake in blender, but it looks correct in blender and loops fine. I also tried scrapping and redoing my walk animation (a simple start pose @ frames 0 & 30, and a reverse pose @ frame 15 ) and got the same error.

I also checked the .skeleton file for my model after exporting, and the last few key frames of atleast 2 bones in my animation have rotation values so it doesn’t look like the file is telling it to pause, but the model still completely pauses on its final frame for about a second before looping

I’m not sure if i accidentally changed some type of simple setting in blender or the scene composer- but I was able to export and run my walk animation perfectly once in the scene composer and in-game. Then after I started adding extra stand and swing animations all of this model’s animations started doing this. Now I still get the problem even when I export my model with just one single animation

here’s a clip of what it looks like

and this is the only code im using right now

control = ((Node)spatial).getChild(“Cube.008-ogremesh”).getControl(AnimControl.class);
channel = control.createChannel();
channel.setAnim(“Walk”);
channel.setLoopMode(LoopMode.Loop);

Can you check if there is an animation pause in blender?

For some reason I can’t quote your post…

but: “pauses for a second or two”

I’m glad you added a video because the above seems like a pretty large exaggeration. In the video, it’s at best a half-a-second which gets it into the realm of explanability.

My guess is that you have very few key frames, maybe? JME has a bug where it won’t interpolate between the last and first key frame. So if you are relying on very sparse keys then you will get these pauses when it loops.

@themiddleman It doesn’t have an animation pause in blender for the animations, it looks like its working alright there and I got the walk animation to run in my game once before adding more animations to my .skeleton file, and since then exporting my model with any animation causes this problem.

@pspeed I exported a walk animation with 30 total frames and tried one with 50 frames at one point and still get the issues. The model has 24 bones for this animation, and the animation is 2.083 sec over ~9000 lines in notepad++ if that’s indicative of whether or not theres’s enough keyframes. Here’s the end keyframes for one of the arms in the .skeleton file

        <keyframe time="2.0" >
          <translate x="0.000000" y="-0.000000" z="-0.000000" />
          <rotate angle="1.529594" >
            <axis x="-0.921936" y="-0.205099" z="-0.328586" />
          </rotate>
          <scale x="1.000000" y="1.000000" z="1.000000" />
        </keyframe>
        <keyframe time="2.0416666666666665" >
          <translate x="0.000000" y="-0.000000" z="-0.000000" />
          <rotate angle="1.529594" >
            <axis x="-0.921936" y="-0.205099" z="-0.328586" />
          </rotate>
          <scale x="1.000000" y="1.000000" z="1.000000" />
        </keyframe>
        <keyframe time="2.0833333333333335" >
          <translate x="0.000000" y="-0.000000" z="-0.000000" />
          <rotate angle="1.529594" >
            <axis x="-0.921936" y="-0.205099" z="-0.328586" />
          </rotate>
          <scale x="1.000000" y="1.000000" z="1.000000" />
        </keyframe>
      </keyframes>
    </track>

I was just guessing because I know that is an issue. I don’t know enough about things to speculate further other than maybe JME thinks that your animation is longer than it actually is.

From the video of your animation, it could have been done with only a handful of key frames so I was just guessing.

I’m wondering if it may have to do with the past animations I have that were 50 frames long. It definitely looks like the swing and stand animation pause longer, and those are only 24 frames as opposed to the walk animation which was actually 40 frames; maybe if I make everything back to 50 frames that’ll fix it, I’ll give it a try.

It looks like that was the issue, although i think it was something I did on the blender side, anytime I’d export an animation at less than 50 frames the skeleton file would export it as if i twere still 50 frames. I found a single pose I must’ve repeatedly overlooked that was on the 50th frame for one single bone in the stand animation, and I had to use the select all command on the bones in the NLA to see the frame I had been overlooking; for some reason the other ways I was selecting it wren’t showing me all the bones and frames - I’m not entirely sure why/how this was also affecting other animations that never had more than 30 frames but I can’t say I’ve entirely figured out all of blenders nuances with animation quite yet :wink:. I’ve noticed using blender for animation can be tricky sometimes working with the dopesheet and NLA editor, but I could probably benefit from taking it a little slower the next time I animate a new model and keep an eye out for any little errors like this to catch them right away.