Hello everybody. Hopefully somebody here can help me with this.
I'm using irrlicht to make an animated storytelling game, where characters act out a scene and occasionally the player has a choice of how the story progresses. Unfortunately, I'm a complete amateur at programming/computer graphics and I'm having trouble with character animation.
Currently I'm using Blender to model, rig and animate my characters before exporting them to Blitz3D format. I can then display that animated character in irrlicht without any problems. However, this only lets me display a single looping animation.
Want I want to know is:
-How do I make a model so that it is has several animations in its file?
-How do I select between these animations in irrlicht so that I can make a character do one thing and then another different thing, rather than a single looping animation?
Apologies in advance if this is a dumb question or it's been asked before- I searched as thoroughly as I could before asking.
Having problem with basic animations/scripting
Re: Having problem with basic animations/scripting
You can set the frames between which it loops in IAnimatedMeshSceneNode::setFrameLoop. So if you have several animations in your file you have to write down the frames for each animation and then set the correponding start-end frame which you need.
Don't know yet much about Blender export myself (I just got back into Blender recently and haven't created new animations yet - old script I used for Blender 2.49 no longer works).
Don't know yet much about Blender export myself (I just got back into Blender recently and haven't created new animations yet - old script I used for Blender 2.49 no longer works).
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: Having problem with basic animations/scripting
Thanks for the help. So the idea is to just have one long animation per model, but to subdivide it into lots of sub-animations for particular actions? So frames 1-20 would be the walking animation, 20-50 would be idle... etc etc.?
I'll give this a try over the weekend.
I'll give this a try over the weekend.
Re: Having problem with basic animations/scripting
Hello Lymmot,
Welcome to irrlicht community.
Your model file has one timeline in which you put your animations. You can't make separate animations so far as I know. As CuteAlien said you can manipulate the animation by special functions like:
character->setFrameLoop(int start_frame, int end_frame); //it will play only the selected frames
character->setAnimationSpeed(int frames_per_second); // controls animation speed
character->setLoopMode(bool looping); // with this function you can stop the animation
Furthermore I my advice for you would be not to get involved into big project at once but to develop game elements in separate projects... Also you should get the NEW Visual Studio, unless you have one, as it would show you all available functions to you characters... So now you're on your own..
Good luck.
Welcome to irrlicht community.
Your model file has one timeline in which you put your animations. You can't make separate animations so far as I know. As CuteAlien said you can manipulate the animation by special functions like:
character->setFrameLoop(int start_frame, int end_frame); //it will play only the selected frames
character->setAnimationSpeed(int frames_per_second); // controls animation speed
character->setLoopMode(bool looping); // with this function you can stop the animation
Furthermore I my advice for you would be not to get involved into big project at once but to develop game elements in separate projects... Also you should get the NEW Visual Studio, unless you have one, as it would show you all available functions to you characters... So now you're on your own..
Good luck.
Re: Having problem with basic animations/scripting
Yeah - that's the usual way. There's a more complicated way as well by splitting the model and animations in different files and merging them in code again, but that's basically only needed when you want to re-use same animations for different models.
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: Having problem with basic animations/scripting
OK, thank you both.
Re: Having problem with basic animations/scripting
there is also the option of using a custom animator to read stored individual animations from the mesh and apply them using joint control as shown at http://www.irrlicht3d.org/wiki/index.ph ... tionSystem
Re: Having problem with basic animations/scripting
Hello... it's me again. I have another problem that I can't figure out on my own and this time its about scripting. I've put it here because its closely related to my previous questions.
I want to make a program where a sequence of animations runs one after another, like a long cutscene, accompanied by things like moving cameras and audio dialogue playing. Unfortunately my knowledge of C++ is extremely poor and I don't know how to set up an event sequence like this. I can do the individual things like play audio and position character models, but not chaining events together in sequence.
So in short:
How can I make it so that a character completing an action, such as reaching the final frame of its animation or completing movement to a particular position, will trigger the start of another action?
I've seen things like the IAnimationEndCallback interface which might be useful for something like this, but without examples I haven't been able to understand how to use it.
I want to make a program where a sequence of animations runs one after another, like a long cutscene, accompanied by things like moving cameras and audio dialogue playing. Unfortunately my knowledge of C++ is extremely poor and I don't know how to set up an event sequence like this. I can do the individual things like play audio and position character models, but not chaining events together in sequence.
So in short:
How can I make it so that a character completing an action, such as reaching the final frame of its animation or completing movement to a particular position, will trigger the start of another action?
I've seen things like the IAnimationEndCallback interface which might be useful for something like this, but without examples I haven't been able to understand how to use it.