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 );
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.