Well, back in 1.5.1 I modeled a rotating cube in Blender. I wanted a b3d file so I used gandaldf's b3d exporter. The coder warns about cyclic animation saying "I suggest you to copy the first frame to the last in way to have the model exactly in the same position". I did that and positively I had a cyclic animation in 1.5.1.
But, now in 1.7 or 1.6 that cylic animation is lost. I tried many things (like deleting that last extra frame) with no luck. In my program I can see that the last frame of the model can't show up.
Here you have the blend and b3d files in question http://www.mediafire.com/?minri2gjgyz
B3D cyclic animations in 1.7 or 1.6
I think after 1.5 we had the change to a 0-based frame index for the b3d animations. So in your code you might have to change setFrameLoop.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
It's something like this
I need to increase or decrease one frame at a time.
Code: Select all
if(newframe>frame)
modelo_b->setFrameLoop(frame, newframe);
else
modelo_b->setFrameLoop(newframe-1, frame-1);
frame = newframe;
I had that issue with a walk cycle. It may be related to IPO curves, but I can't be sure.
The walk cycle basically has the same bone positions in the first and last frame... But unlike in Blender itself, it was jerky when it looped, so I tried all kinds of different setFrameLoop values, and it didn't seem to make a difference... What I had to do was not just have the first frame duplicated at the end of the cycle, but the first two frames... Now the animation is completely seamless.
i.e. instead of having:
K1, K2, K3, K4, K5, K1
I had to make it:
K1, K2, K3, K4, K5, K1, K2
The walk cycle basically has the same bone positions in the first and last frame... But unlike in Blender itself, it was jerky when it looped, so I tried all kinds of different setFrameLoop values, and it didn't seem to make a difference... What I had to do was not just have the first frame duplicated at the end of the cycle, but the first two frames... Now the animation is completely seamless.
i.e. instead of having:
K1, K2, K3, K4, K5, K1
I had to make it:
K1, K2, K3, K4, K5, K1, K2