MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / animatesMatFrame

Method animatesMatFrame

Engine/source/ts/collada/colladaAppMesh.cpp:363–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363bool 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
399bool ColladaAppMesh::animatesFrame(const AppSequence* appSeq)
400{

Callers

nothing calls this directly

Calls 11

dStrEqualFunction · 0.85
findInputSourceFunction · 0.85
getTargetsMethod · 0.80
getFloat_arrayMethod · 0.80
sizeMethod · 0.45
getStartMethod · 0.45
getEndMethod · 0.45
getCountMethod · 0.45
getSemanticMethod · 0.45
isAnimatedMethod · 0.45

Tested by

no test coverage detected