Write to an OGRE binary skeleton
| 516 | |
| 517 | // Write to an OGRE binary skeleton |
| 518 | MStatus Skeleton::writeOgreBinary(ParamList ¶ms) |
| 519 | { |
| 520 | MStatus stat; |
| 521 | // Construct skeleton |
| 522 | MString name = "exportSkeleton"; |
| 523 | Ogre::SkeletonPtr pSkeleton = Ogre::SkeletonManager::getSingleton().create(name.asChar(), |
| 524 | Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); |
| 525 | // Create skeleton bones |
| 526 | stat = createOgreBones(pSkeleton,params); |
| 527 | if (stat != MS::kSuccess) |
| 528 | { |
| 529 | std::cout << "Error writing skeleton binary file\n"; |
| 530 | std::cout.flush(); |
| 531 | } |
| 532 | // Create skeleton animation |
| 533 | if (params.exportSkelAnims) |
| 534 | { |
| 535 | stat = createOgreSkeletonAnimations(pSkeleton,params); |
| 536 | if (stat != MS::kSuccess) |
| 537 | { |
| 538 | std::cout << "Error writing ogre skeleton animations\n"; |
| 539 | std::cout.flush(); |
| 540 | } |
| 541 | } |
| 542 | pSkeleton->setBindingPose(); |
| 543 | // Optimise animations |
| 544 | pSkeleton->optimiseAllAnimations(); |
| 545 | // Export skeleton binary |
| 546 | Ogre::SkeletonSerializer serializer; |
| 547 | serializer.exportSkeleton(pSkeleton.get(),params.skeletonFilename.asChar()); |
| 548 | pSkeleton.reset(); |
| 549 | // Skeleton successfully exported |
| 550 | return MS::kSuccess; |
| 551 | } |
| 552 | |
| 553 | // Write joints to an Ogre skeleton |
| 554 | MStatus Skeleton::createOgreBones(Ogre::SkeletonPtr pSkeleton,ParamList& params) |
nothing calls this directly
no test coverage detected