mikachu
17-03-2006 15:50:17
I have the following problem: because of animation opimisation, some tracks are not written into the skeleton file. The issue is when you mix the animation which is missing a track with another which is not: in this case, there is a huge difference between setblendweight(0.0) and setenabled(false), because the track doesn't exist in the other animation.
My question is: is there a way of disabling this optimisation, or will it be possible for the next version?
Lioric
17-03-2006 19:13:34
Probably its a better idea to export the empty tracks (i.e. with no keyframes) so the optimization is processed, but all the tracks are there, because even when the optimization is not active, tracks that dont have transform information will not be saved
If you can create a test bed scene where this issue is present, it can help to implemente it faster in the next update
mikachu
20-03-2006 00:49:37
Ok, I've solved my problem just by adding void animation tracks at runtime.
Here is the code:
Ogre::Animation* anim=Entite->getSkeleton()->getAnimation("Idle");
Skeleton::BoneIterator bn=Entite->getSkeleton()->getBoneIterator();
while (bn.hasMoreElements())
{
Bone* bone=bn.getNext();
std::string s=bone->getName();
unsigned short hand=bone->getHandle();
if (!anim->hasNodeTrack(hand))
{
anim->createNodeTrack(hand,bone);
TransformKeyFrame* nkf=anim->getNodeTrack(hand)->createNodeKeyFrame(0.0);
nkf->setRotation(Ogre::Quaternion(Ogre::Radian(0.0),Vector3(1.0,0.0,0.0)));
nkf->setTranslate(Vector3::ZERO);
}
}
However, I still think that this functionnality should be added to oFusion.
For information, I tested this bug with this little code in the framelistener (in this case, nextAnimState is the animationstate where some bones have no track in the file):
currentAnimState->addTime(dt);
nextAnimState->addTime(dt);
currentAnimState->setWeight(1.0);
nextAnimState->setWeight(0.0);
if (sin(2*time)>0.0) nextAnimState->setEnabled(true);else nextAnimState->setEnabled(false);
About a test bed scene, I have no website atm, so I can't post the file...
Lioric
20-03-2006 17:10:17
Added to the list, expect it to be on the next update