loads animations for already loaded model
| 259 | |
| 260 | // loads animations for already loaded model |
| 261 | bool CryModelLoader::loadAnimations() |
| 262 | { |
| 263 | AUTO_PROFILE_SECTION(g_dTimeAnimLoadBind); |
| 264 | |
| 265 | // the number of animations loaded |
| 266 | unsigned numAnimations = 0; |
| 267 | |
| 268 | { |
| 269 | AUTO_PROFILE_SECTION (g_dTimeTest1); |
| 270 | if(m_fCalFile) |
| 271 | numAnimations = loadAnimationsWithCAL (); |
| 272 | else |
| 273 | if (m_nCafFindFileHandle != -1) |
| 274 | numAnimations = loadAnimationsNoCAL (); |
| 275 | } |
| 276 | |
| 277 | { |
| 278 | AUTO_PROFILE_SECTION(g_dTimeTest2); |
| 279 | if (!numAnimations && !m_pModel->numMorphTargets()) |
| 280 | { |
| 281 | g_GetLog()->LogWarning ("\004CryModelLoader::loadAnimations(%s): couldn't find any animations for the model. Standalone character will be useless.", m_strGeomFileNameNoExt.c_str()); |
| 282 | //return false; |
| 283 | } |
| 284 | |
| 285 | if (!m_bLoadFromCCG) |
| 286 | { |
| 287 | g_GetLog()->UpdateLoadingScreenPlus ("\003 precomputing"); |
| 288 | m_pModel->LoadPostInitialize (!m_bBoneInitPosInitialized); |
| 289 | g_GetLog()->UpdateLoadingScreenPlus ("\003done."); |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | if (numAnimations) |
| 294 | g_GetLog()->UpdateLoadingScreen(" %d animations loaded (total animations: %d)", numAnimations, m_pControllerManager->NumAnimations()); |
| 295 | |
| 296 | // m_pControllerManager->LogUsageStats(); |
| 297 | //m_pModel->shrinkControllerArrays(); |
| 298 | |
| 299 | return m_pModel->m_pDefaultModelState |
| 300 | && ((m_pModel->numBoneInfos() |
| 301 | && m_pModel->m_pDefaultModelState->getRootBone()) |
| 302 | || m_pModel->numMorphTargets()); |
| 303 | } |
| 304 | |
| 305 | // loads the animations from the array: pre-allocates the necessary controller arrays |
| 306 | // the 0th animation is the default animation |
nothing calls this directly
no test coverage detected