MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / writeAnimation

Method writeAnimation

Tools/MeshTool/src/XML/OgreXMLSkeletonSerializer.cpp:547–575  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

545 }
546 //---------------------------------------------------------------------
547 void XMLSkeletonSerializer::writeAnimation(TiXmlElement* animsNode,
548 const Animation* anim)
549 {
550 TiXmlElement* animNode =
551 animsNode->InsertEndChild(TiXmlElement("animation"))->ToElement();
552
553 animNode->SetAttribute("name", anim->getName());
554 animNode->SetAttribute("length", StringConverter::toString(anim->getLength()));
555
556 // Optional base keyframe information
557 if (anim->getUseBaseKeyFrame())
558 {
559 TiXmlElement* baseInfoNode =
560 animNode->InsertEndChild(TiXmlElement("baseinfo"))->ToElement();
561 baseInfoNode->SetAttribute("baseanimationname", anim->getBaseKeyFrameAnimationName());
562 baseInfoNode->SetAttribute("basekeyframetime", StringConverter::toString(anim->getBaseKeyFrameTime()));
563 }
564
565 // Write all tracks
566 TiXmlElement* tracksNode =
567 animNode->InsertEndChild(TiXmlElement("tracks"))->ToElement();
568
569 Animation::OldNodeTrackIterator trackIt = anim->getOldNodeTrackIterator();
570 while (trackIt.hasMoreElements())
571 {
572 writeAnimationTrack(tracksNode, trackIt.getNext());
573 }
574
575 }
576 //---------------------------------------------------------------------
577 void XMLSkeletonSerializer::writeAnimationTrack(TiXmlElement* tracksNode,
578 const OldNodeAnimationTrack* track)

Callers

nothing calls this directly

Calls 11

TiXmlElementClass · 0.85
InsertEndChildMethod · 0.80
SetAttributeMethod · 0.80
getUseBaseKeyFrameMethod · 0.80
getBaseKeyFrameTimeMethod · 0.80
hasMoreElementsMethod · 0.80
toStringFunction · 0.50
ToElementMethod · 0.45
getNameMethod · 0.45
getLengthMethod · 0.45
getNextMethod · 0.45

Tested by

no test coverage detected