MCPcopy Create free account
hub / github.com/KhronosGroup/OpenCOLLADA / readMayaTransformations

Method readMayaTransformations

dae2ma/src/DAE2MAVisualSceneImporter.cpp:375–522  ·  view source on GitHub ↗

-----------------------------------

Source from the content-addressed store, hash-verified

373
374 // -----------------------------------
375 bool VisualSceneImporter::readMayaTransformations (
376 const COLLADAFW::Node* node,
377 MayaTransform& mayaTransform,
378 MayaDM::Transform* transformNode,
379 std::vector<TransformAnimation>& transformAnimations,
380 bool& hasRotatePivot,
381 bool& hasScalePivot,
382 bool& isLookatTransform )
383 {
384 bool validMayaTransform = true;
385
386 const COLLADAFW::UniqueId& transformId = node->getUniqueId ();
387
388 // Not every animation can be imported. So if we have more then one translation in the
389 // current node, we can't import the animation.
390 size_t numTranslations = 0;
391 TransformAnimation translateAnim;
392
393 const COLLADAFW::TransformationArray& transforms = node->getTransformations ();
394 size_t numTransforms = transforms.getCount ();
395 for ( size_t i=0; i<numTransforms && validMayaTransform; ++i )
396 {
397 const COLLADAFW::Transformation* transformation = transforms [i];
398
399 COLLADAFW::Transformation::TransformationType transformType;
400 transformType = transformation->getTransformationType ();
401
402 // Check if we handle a joint node.
403 bool isJoint = ( node->getType () == COLLADAFW::Node::JOINT );
404
405 // Not every animation can be imported. So if we have more then one translation in the
406 // current node, we can't import the animation.
407 bool storeAnimationDirectly = true;
408
409 // Set the transformation information in depend of the transform type.
410 switch ( transformType )
411 {
412 case COLLADAFW::Transformation::LOOKAT:
413 {
414 // Import the camera's lookat transform matrix.
415 importLookatTransform ( node, transformation, transformNode );
416
417 isLookatTransform = true;
418 validMayaTransform = false;
419 return validMayaTransform;
420 }
421 break;
422 case COLLADAFW::Transformation::MATRIX:
423 {
424 // Nothing to do, the matrix will be read automatically.
425 validMayaTransform = false;
426 return validMayaTransform;
427 }
428 break;
429 case COLLADAFW::Transformation::ROTATE:
430 {
431 if ( !isJoint )
432 validMayaTransform = handleTransformRotateValues ( mayaTransform, transformation );

Callers

nothing calls this directly

Calls 15

getUniqueIdMethod · 0.80
getTransformationTypeMethod · 0.80
getAnimationListMethod · 0.80
setTransformationMethod · 0.80
setTransformPhaseMethod · 0.80
setIsJointTransformMethod · 0.80
getCountMethod · 0.45
getTypeMethod · 0.45
getScaleMethod · 0.45
getAngleMethod · 0.45
getRotateAxisMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected