Sign in to follow this  

Output animation from maya in .x format

This topic is 3464 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(); dagIter.next()) { 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(); dgIter.next()) { 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

This topic is 3464 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this