Hi there,
I would need to get my custom deformer node to refresh at given time values. I tried several things, none seems to work fully...
First, I made a mel command that would step through the time range using:
for (float t = startTime; t<=endTime; t+= sampleRate){
MGlobal::viewFrame( t );
.... do stuff ...
}
This would step through time, but no nodes are refreshed (only when the command returns to maya, effectively the last frame of the range).
I guess i would somehow need to force a refresh, maybe by querying the outputGeometry of the deformer node. How could I do that?
I was looking at the forceCache() function of the node, but thats a private function, so my command cant call it (i am not sure i am supposed to call it from outside).
So I tried to do this using mel, which seemed to work:
float $i;
for ($i=$st; $i<=$et; $i+=$sr) {
print ("time now is: " + (string)$i + "n");
currentTime -edit $i;
refresh;
getAttr $actualNodeName.outputGeometry[0];
}
While this SEEMS to work (more on this later), its freaking slow, since the whole scene gets updated and displayed in the viewport.
Funny (but super annoying) thing I found out the other day: if i switch tasks while the script is running, it will yet again fail to update at the given times.
I suppose maya figures that if i am not looking, it doesnt really have to do what i am saying... 
I would be happier if i could do this thing using the API, since that would possibly be a better&faster solution.
Any advice?