Hi,
This is my first post and I'd like to say how much I have enjoyed using irrlicht to date!
I am a 3d modeller/animator and game developer and I am using irrlicht to build a little interactive portfolio.
I have run into a problem with my animated meshes.
I am trying first of all, to determine which is better to use, .X or . B3D?
When I export from Max using Pandas .x exporter, using certain settings, I have to up the animation speed to a 3000-4000 which must not be right.
When I use different settings, I get twitchy half animations and I can't access the other frames using setFrameLoop or anything else.
When I use the b3d exporter, the framerate and animations are perfect, I can acces different animations by just giving different values to the frameLoop function. The issue I have here is that I can't find a way to blend the transitions between different types, because:
A) I have to put all animation in one long sequence as there is no Animation naming or labelling in the b3d exporter.
B) I'm not sure how else to do it?
Could somebody please direct me to a working piece of code, just a helloworld style Skinnedmesh transitioning between animations or a difinitive 3dsmax to irrlicht SkinnedMesh tutorial!?
I would be happy to give tips on modelling and animating in return!!
Cheers.
Problems with Skinned Meshes!!
-
joepaddyroe
- Posts: 2
- Joined: Mon Feb 28, 2011 8:02 pm
- Contact:
-
shadowslair
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
Hi, joepaddyroe.
1) Let`s say you have the following sequences in one file:
0-50 idle
51-75 walk
76-90 run
91-111 attack
2) You can create some helper structure like:
Then you create the 4 structures (one for each animation) and name them.
3) If exported to .X you need to multiply frames by 160 like idle will become from 0-50 to 0-8000. This way they`ll match. I personally prefer .b3d, but it`s not supported by 3dsmax version greater than 9.
4) Load mesh, create a node, set frame loop and speed. Then call:
5) In the main loop you do whatever you do with the character, then call: which will tell Irrlicht you wanna your node to be animated. This needs to be called manually when using JOINT_CONTROL.
6) You create some help function, which will call your animations by name, meaning will read from the 4 structs you created earlier and will call setFrameLoop() and setAnimSpeed(); change transition time if needed etc. Note you will need to check if the called animation is the same as the currently played one, or do sth to avoid anmiation-call-loops which will set the start frame each step.
7) That`s all I think. Should work without much problems. If you look at the irrlicht examples and have some idea of programming, you should be fine...
1) Let`s say you have the following sequences in one file:
0-50 idle
51-75 walk
76-90 run
91-111 attack
2) You can create some helper structure like:
Code: Select all
struct SAnim
{
core::stringc name;
s32 startFrame;
s32 endFrame;
f32 speed;
// (...)
};3) If exported to .X you need to multiply frames by 160 like idle will become from 0-50 to 0-8000. This way they`ll match. I personally prefer .b3d, but it`s not supported by 3dsmax version greater than 9.
4) Load mesh, create a node, set frame loop and speed. Then call:
Code: Select all
node->setJointMode(scene::EJUOR_CONTROL);// just to make it obvious we`re using CONTROL
node->setTransitionTime(0.1f); // transition time- this sets scene::EJUOR_CONTROL automaticallyCode: Select all
node->animateJoints(); 6) You create some help function, which will call your animations by name, meaning will read from the 4 structs you created earlier and will call setFrameLoop() and setAnimSpeed(); change transition time if needed etc. Note you will need to check if the called animation is the same as the currently played one, or do sth to avoid anmiation-call-loops which will set the start frame each step.
7) That`s all I think. Should work without much problems. If you look at the irrlicht examples and have some idea of programming, you should be fine...
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
-
joepaddyroe
- Posts: 2
- Joined: Mon Feb 28, 2011 8:02 pm
- Contact:
-
jibblesmgee
- Posts: 42
- Joined: Thu Jan 06, 2011 9:12 am
Well you already got a good answer, but check this out, you might find it is helpful:
How To Use The "New" Animation System
I know, it's a link to a manual... but no smart a$$ comment.
unless you count that as one.
How To Use The "New" Animation System
I know, it's a link to a manual... but no smart a$$ comment.
unless you count that as one.