Index: source/graphics/Model.cpp =================================================================== --- source/graphics/Model.cpp +++ source/graphics/Model.cpp @@ -459,22 +459,13 @@ if (once) m_Flags |= MODELFLAG_NOLOOPANIMATION; - if (!m_BoneMatrices && anim->m_AnimDef) - { - // not boned, can't animate - return false; - } - - if (m_BoneMatrices && !anim->m_AnimDef) - { - // boned, but animation isn't valid - // (e.g. the default (static) idle animation on an animated unit) + // Not rigged or animation is not valid. + if (!m_BoneMatrices || !anim->m_AnimDef) return false; - } - if (anim->m_AnimDef && anim->m_AnimDef->GetNumKeys() != m_pModelDef->GetNumBones()) + if (anim->m_AnimDef->GetNumKeys() != m_pModelDef->GetNumBones()) { - // mismatch between model's skeleton and animation's skeleton + // Mismatch between model's skeleton and animation's skeleton. LOGERROR("Mismatch between model's skeleton and animation's skeleton (%s.dae has %lu model bones while the animation %s has %lu animation keys.)", m_pModelDef->GetName().string8().c_str() , static_cast(m_pModelDef->GetNumBones()), @@ -483,11 +474,11 @@ return false; } - // reset the cached bounds when the animation is changed + // Reset the cached bounds when the animation is changed. m_ObjectBounds.SetEmpty(); InvalidateBounds(); - // start anim from beginning + // Start anim from beginning. m_AnimTime = 0; }