| 361 | } |
| 362 | |
| 363 | bool ColladaAppMesh::animatesMatFrame(const AppSequence* appSeq) |
| 364 | { |
| 365 | // Texture coordinates may be animated in two ways: |
| 366 | // - by animating the MAYA profile texture transform (diffuse texture) |
| 367 | // - by animating the morph weights for morph targets with different UVs |
| 368 | |
| 369 | // Check if the MAYA profile texture transform is animated |
| 370 | for (S32 iMat = 0; iMat < appMaterials.size(); iMat++) { |
| 371 | ColladaAppMaterial* appMat = static_cast<ColladaAppMaterial*>(appMaterials[iMat]); |
| 372 | if (appMat->effectExt && |
| 373 | appMat->effectExt->animatesTextureTransform(appSeq->getStart(), appSeq->getEnd())) |
| 374 | return true; |
| 375 | } |
| 376 | |
| 377 | // Check that the morph weights are animated within the sequence interval, |
| 378 | // and that the morph targets have different UVs to the base geometry. |
| 379 | bool animated = false; |
| 380 | bool differentUVs = false; |
| 381 | if (const domMorph* morph = getMorph()) { |
| 382 | for (S32 iInput = 0; iInput < morph->getTargets()->getInput_array().getCount(); iInput++) { |
| 383 | const domInputLocal* input = morph->getTargets()->getInput_array()[iInput]; |
| 384 | if (dStrEqual(input->getSemantic(), "MORPH_TARGET")) { |
| 385 | // @todo: Check if morph targets have different UVs to base geometry |
| 386 | differentUVs = false; |
| 387 | } |
| 388 | if (dStrEqual(input->getSemantic(), "MORPH_WEIGHT")) { |
| 389 | const domSource* source = daeSafeCast<domSource>(findInputSource(input)); |
| 390 | AnimatedFloatList weights(source ? source->getFloat_array() : 0); |
| 391 | animated = weights.isAnimated(appSeq->getStart(), appSeq->getEnd()); |
| 392 | } |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | return (animated && differentUVs); |
| 397 | } |
| 398 | |
| 399 | bool ColladaAppMesh::animatesFrame(const AppSequence* appSeq) |
| 400 | { |
nothing calls this directly
no test coverage detected