PDA

View Full Version : MFnAnimCurve only for MPoints


jaba1984
10-27-2010, 10:00 PM
Hello,
I am fairly new to Python and the Maya API.
I want to take an object, which is selected in Maya, add a deformer to it and animate this deformer over time. I have no trouble creating a MFnLatticeDeformer and add the selected geometry to it. I also figured out, how to access each control point of the lattice. But now I want to translate each control point over time, depending on its relativ position within the lattice. I also found sample code on how to create an MFnAnimCurve:

MString attrName( “translateX” );
const MObject attrX = fnSet.attribute( attrName, &status );

MFnAnimCurve acFnSetX;
acFnSetX.create( mObject.transform(), attrX, NULL, &status );


But this code only translates the whole object. How can I create a MFnAnimCurve for each control point of a lattice? Maybe I am totally wrong and I will need to use a different approach here. So, please give me information on how to do this.
Thanks guys!

CGTalk Moderation
10-27-2010, 10:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.