I need to keep anim node alive when its keys are deleted because I have 'build-in' animation controllers that handles the keys and perform an interpolation (mesh morphing). animCurves are used just for interface with maya to enable user to edit keys on timeline , dope sheet etc. So I need to keep consistency between 'internal controllers' and aninCurve nodes (one to one)
So I do not like when maya automatically deletes an animCurve when I delete all its keys. I got an 'internal conroller' with lost curve node.
So I need to do one of:
a ) delete internal animation controller as well
b ) reconnect it again when adding keys and found that there is no animNode is connecgted to correspondent plug.
like this:
CODE
trackPlug = trackArray.elementByLogicalIndex(idx, &stat);
if(!trackPlug.isConnected())
{
MFnAnimCurve animFn;
animFn.create(trackPlug,&_dgMod(),&stat);
}
I just wander is it safe.
for exampe, if I have tracks 0..5 and animCurves connected to elements of array plug for each of them. So I If delete all keys of track #3 maya deletes curve node #3 but I still have track #3. So when later I want to add the key to track #3 I get elementByLogicaIndex wiht index 3 and reconnect animNode.
Can I be sure that I got actually 3 element? Because it seems maya eliminates elements from array that is disconnected. Is not it?