Hello there. I'm working on an open-source project using the Irrlicht engine, and took the initiative of implementing 3D model support (with object to object attachments). It's meant to work with animated skeletal models, which are used under the x format (created and exported from Blender). I can properly set the mesh on an IAnimatedMeshSceneNode and loop animations using setFrameLoop(start, end). However, I'm having serious issues when it comes preforming special tasks with skeletal bones / joints of the mesh.
The issue is that when I try to enable individual control of joints or animation blending, it doesn't work. It will also cause animations to no longer play (stay at frame 1 I believe) and oddly enough, the normals of the mesh get inverted and its surface shows inside-out. On the topic of bone control, I need to be able to manually override the rotation of individual bones without affecting other bones and the current animation. For example, to have a character's head looking up or down depending on where the player is looking, but without interfering with the walk / run / stand / etc animation playing on that model (just take control of the head joint). I hope that is possible in Irrlicht at this day.
What I'm currently trying is: First of all I read I must enable some flags on the node. For animation blending (setTransitionTime(speed)) I need to set node->animateJoints() which I'm doing after I create the node. This works and causes no issues. However, setting animation transitioning time to anything other than 0 causes the error I mentioned. Next, to manually override joint position / rotation, I heard I must do node->setJointMode(irr::scene::EJUOR_CONTROL) first. If I enable this however, I once again get the same issue. I would later get the bone using irr::scene::IBoneSceneNode* bone = node->getJointNode(bone_name) and change position and rotation via bone->setPosition and bone->setRotation... but due to the problem I don't get to this point yet.
Why does enabling skeletal control or animation transitioning on animated mesh nodes not work and cause animations to stop working at all? Is it an issue with the x mesh format, or the native Blender exporter for it? Or is it a known Irrlicht bug or another flag I'm forgetting?
Joint control and animation transitioning not working
-
- Posts: 9
- Joined: Thu Nov 08, 2012 10:49 pm
-
- Posts: 9
- Joined: Thu Nov 08, 2012 10:49 pm
Re: Joint control and animation transitioning not working
I did more tests on this today. It appears that using setJointMode(irr::scene::EJUOR_CONTROL) then modifying the position / rotation of a bone does work properly itself. But it also causes animations to break and mesh normals to get inverted. It also makes children parented to a bone of that parent to go to origin 0,0,0.
Here are two screenshots of the project where I'm using this. In the first screenshot, I don't use EJUOR_CONTROL and both meshes work fine attached to each other. In the second screenshot, EJUOR_CONTROL is enabled, causing them to no longer animate and the model to show inside-out (the stretch is normal as I offset one of the joints in my test, that part works). Any help on this would be appreciated.
Here are two screenshots of the project where I'm using this. In the first screenshot, I don't use EJUOR_CONTROL and both meshes work fine attached to each other. In the second screenshot, EJUOR_CONTROL is enabled, causing them to no longer animate and the model to show inside-out (the stretch is normal as I offset one of the joints in my test, that part works). Any help on this would be appreciated.
-
- Posts: 40
- Joined: Sat Feb 06, 2010 9:00 pm
- Location: Ohio, USA
Re: Joint control and animation transitioning not working
I'm wondering if it might be related to this little proposed fix (suggested by another forum member), which might or might not have made it into the version 1.8 release of the SDK:
http://irrlicht.sourceforge.net/forum/v ... =7&t=47041
I also play with SVN checkouts of Irrlicht, and usually I read the SVN logs, but I can't recall if the developers ever included the fix (or something based upon it) or not.
I don't have time right now to pull up the 1.8 release source I downloaded and check myself, but I hope this info helps.
http://irrlicht.sourceforge.net/forum/v ... =7&t=47041
I also play with SVN checkouts of Irrlicht, and usually I read the SVN logs, but I can't recall if the developers ever included the fix (or something based upon it) or not.
I don't have time right now to pull up the 1.8 release source I downloaded and check myself, but I hope this info helps.
- - - -
"Destructavator" Dave: Developer of OS GPL VST "ScorchCrafter" Audio Plug-ins, contributer to UFO AI, Day Job: Guitar Luthier (Customize musical instruments, repainting w/ custom artwork, graphics, logos, decals, etc.)
"Destructavator" Dave: Developer of OS GPL VST "ScorchCrafter" Audio Plug-ins, contributer to UFO AI, Day Job: Guitar Luthier (Customize musical instruments, repainting w/ custom artwork, graphics, logos, decals, etc.)
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Joint control and animation transitioning not working
Well, I wrote that it will be postponed to a later 1.8.x release, so no, won't be in the 1.8 release.