I am animating a character with some walk/dance animations.
At the same time, I want to play a speak animation. Now this speak animation should be limited to a certain number of bones.
I figured BlendMasks would be the way to go here (as I have no possibility of exporting the speak anim affecting only those bones).
Here is what I do:
Code: Select all
// Play lip animations
Ogre::AnimationState* animState = _characterEntity->getAnimationState("speak_mouth_open");
animState->createBlendMask(_characterEntity->getSkeleton()->getNumBones(), 0.0f);
Ogre::Bone* bone = _characterEntity->getSkeleton()->getBone("upper_lip_center_speak");
animState->setBlendMaskEntry(bone->getHandle(), 1.0f);
bone = _characterEntity->getSkeleton()->getBone("lower_lip_center_speak");
animState->setBlendMaskEntry(bone->getHandle(), 1.0f);
animState->setEnabled(true);
animState->setTimePosition(0.0f);
As soon as I add any BlendMaskEntry, the whole animation is applied. When I do not set any entries, the animation is not shown at all, which is correct, due to the initial weight of 0.0f.
Any ideas what could be wrong here?
Neither of these bones are parents to other bones.
If it is of any importance, I add the "speak_mouth_open" animation via _mergeSkeletonAnimations from an extra exported .skeleton file.
All of our animations are exported into an extra .skeleton file and merged with the "master" skeleton (which simply is the first of the external ones which is loaded in a different way).