Joint control and animation transitioning not working
Posted: Thu Nov 08, 2012 11:56 pm
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?
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?