B3D cyclic animations in 1.7 or 1.6

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
ragnatic
Posts: 14
Joined: Sun Nov 22, 2009 5:11 am

B3D cyclic animations in 1.7 or 1.6

Post by ragnatic »

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
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

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
ragnatic
Posts: 14
Joined: Sun Nov 22, 2009 5:11 am

Post by ragnatic »

I finally got the cyclic animation by copying the first frame in the beginning of the animation and two times in the end. Something like this:

1 1 2 4 5 6 1 1
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

What's the code to set the frame loop?
ragnatic
Posts: 14
Joined: Sun Nov 22, 2009 5:11 am

Post by ragnatic »

It's something like this

Code: Select all

       if(newframe>frame)
                    modelo_b->setFrameLoop(frame, newframe);

                else
                    modelo_b->setFrameLoop(newframe-1, frame-1);

                frame = newframe;
I need to increase or decrease one frame at a time.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, this is one weird point, but what I meant is which actual numbers do you pass to this function?
ragnatic
Posts: 14
Joined: Sun Nov 22, 2009 5:11 am

Post by ragnatic »

Ideally numbers 0 through 5 because my model has 6 frames. But with the modifications i posted i pass 1 through 6.

BTW, I got the cylic animation in the Meshviewer but not in my program.
kiwibonga
Posts: 3
Joined: Sun Feb 14, 2010 3:25 am

Post by kiwibonga »

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
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I'd need some code which makes this problem visible.
Post Reply