Message 1 of 1
MFnAnimCurve only for certain MPoints

Not applicable
10-27-2010
03:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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!
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!