Advertisement Jump to content
Sign in to follow this  

Output animation from maya in .x format

This topic is 3863 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have the "How to Write a Simple Maya Model Exporter" article and the cvxporter export plugin. But when exporting animations, cvxporter asks the user to input the start frame and end frame, then for every kTransform in Dag, it uses a loop to set the frame times and get rotate\tanslate\scale info at that time. After talking to our artists, i konw that only a few joints have rotate\tanslate\scale data at every frame( like foot which uses IK ). Obviously, the cvxporter method produces too much data. "How to Write a Simple Maya Model Exporter" is better. void findFrames() { MItDag dagIter( MItDag::kBreadthFirst, MFn::kInvalid, &stat ); MTime maxKeyTime = 0; for ( ; !dagIter.isDone(); { MDagPath dagPath; stat = dagIter.getPath( dagPath ); MFnDagNode dn( dagPath ); // find all the motion nodes MItDependencyGraph dgIter( dagPath.node(), MFn::kAnimCurve, MItDependencyGraph::kUpstream, MItDependencyGraph::kBreadthFirst, MItDependencyGraph::kNodeLevel, &stat ); if ( stat ) { // get all the keyframe times for ( ; !dgIter.isDone(); { MObject anim = dgIter.thisNode( &stat ); MFnAnimCurve animCurve( anim, &stat ); // found some keyframe information if ( MS::kSuccess == stat ) { u32 numKeys = animCurve.numKeyframes( &stat ); for ( u32 currKey = 0; currKey < numkeys; currkey++ ) { // truncating values here... mtime keytime = animcurve.time( currkey, &stat ); // store this key frame time somewhere. storekeytime( keytime ); // and store the maximum frame time if ( time > maxKeyTime ) maxKeyTime = time; } } } } } } I said that it`s better coz it shows me kAnimCurve. But to avoid unnecessary data, I must be able to know how animation curves relate to diffent parts of the mesh. I tried to use each kTransform as the root to find its animation curve, but I got garbage exported. Give me some advice, THX

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!