Code: Select all
void CSkinnedMesh::checkForAnimation()
{
..................
if (HasAnimation)
{
//--- Find the length of the animation ---
AnimationFrames=0;
for(i=0;i<AllJoints.size();++i)
{
if (AllJoints[i]->UseAnimationFrom)
{
if (AllJoints[i]->UseAnimationFrom->PositionKeys.size())
if (AllJoints[i]->UseAnimationFrom->PositionKeys.size()+1 > AnimationFrames)
AnimationFrames=AllJoints[i]->UseAnimationFrom->PositionKeys.size()+1;
if (AllJoints[i]->UseAnimationFrom->ScaleKeys.size())
if (AllJoints[i]->UseAnimationFrom->ScaleKeys.size()+1 > AnimationFrames)
AnimationFrames=AllJoints[i]->UseAnimationFrom->ScaleKeys.size()+1;
if (AllJoints[i]->UseAnimationFrom->RotationKeys.size())
if (AllJoints[i]->UseAnimationFrom->RotationKeys.size()+1 > AnimationFrames)
AnimationFrames=AllJoints[i]->UseAnimationFrom->RotationKeys.size()+1;
}
}
}
}
Code: Select all
if (HasAnimation)
{
//--- Find the length of the animation ---
AnimationFrames=0;
for(i=0;i<AllJoints.size();++i)
{
if (AllJoints[i]->UseAnimationFrom)
{
if (AllJoints[i]->UseAnimationFrom->PositionKeys.size())
if (AllJoints[i]->UseAnimationFrom->PositionKeys[AllJoints[i]->UseAnimationFrom->PositionKeys.size()-1].frame+1 > AnimationFrames)
AnimationFrames=AllJoints[i]->UseAnimationFrom->PositionKeys[AllJoints[i]->UseAnimationFrom->PositionKeys.size()-1].frame+1;
if (AllJoints[i]->UseAnimationFrom->ScaleKeys.size())
if (AllJoints[i]->UseAnimationFrom->ScaleKeys[AllJoints[i]->UseAnimationFrom->ScaleKeys.size()-1].frame+1 > AnimationFrames)
AnimationFrames=AllJoints[i]->UseAnimationFrom->ScaleKeys[AllJoints[i]->UseAnimationFrom->ScaleKeys.size()-1].frame+1;
if (AllJoints[i]->UseAnimationFrom->RotationKeys.size())
if (AllJoints[i]->UseAnimationFrom->RotationKeys[AllJoints[i]->UseAnimationFrom->RotationKeys.size()-1].frame+1 > AnimationFrames)
AnimationFrames=AllJoints[i]->UseAnimationFrom->RotationKeys[AllJoints[i]->UseAnimationFrom->RotationKeys.size()-1].frame+1;
}
}
}