I have an animation that is 1 frame: It starts on frame 70 and ends on frame 70 and I have set the animation speed to 1 frame per second.
I expect the callback to be called after 1 second but it doesn't trigger unless I have atleast 2 frames. Is there a way to have 1 frame and still get this to work?
AnimationEnd Callback not called for 1 frame animation
Re: AnimationEnd Callback not called for 1 frame animation
That's probably tricky to fix. You can look at the code in CAnimatedMeshSceneNode::buildFrameNr where it runs that callback. Basically StartFrame==EndFrame is already a special case.
Maybe you can just add 1 still-frame to your animation then you can use that.
Or maybe you need a setLoopMode with a timer? That would be relatively easy to patch I guess?
Or do you have any other patch ideas?
Maybe you can just add 1 still-frame to your animation then you can use that.
Or maybe you need a setLoopMode with a timer? That would be relatively easy to patch I guess?
Or do you have any other patch ideas?
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
Re: AnimationEnd Callback not called for 1 frame animation
I did just add a frame of animation to it. To be honest, I was never going to use the single frame of animation in my final build but I was using here for testing other stuff. If StartFrame==EndFrame is already a special case then maybe there is something else I am doing that I am not aware of. I will dig into my code further to see. If you end up patching it, please let me know and I will go on head and pull your latest changes. Thanks for the reply.
Re: AnimationEnd Callback not called for 1 frame animation
Well, not patching this case - as it looks correct to me. But if you need something like a paused animation - like a timed loop - that can be added. Depends a bit what the use-case is here.
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