Hi there,
I'm working on an MPxLocatorNode, and i have to get the value of a plug at a given time. I can do it, using an MContext, and it works perfectly :
MTime t( 10. );
MDGContext ctx( t );
plug.getValue( oInput, ctx );
However, when i'm doing it in a loop (i.e. with a dynamic time), Maya will run indefinitely, even after the draw() has been done :
for (double i=0.; i < 2.; i += 1.)
{
plug.getValue( oInput, ctx );
}
// this will never stop being evaluated.
I'm assuming it's because even though i'm using a MContext, a redraw of my locator is triggered, somehow. Then, because this redraw is triggered, my draw method gets run again, causing another redraw, and so on ?
But then, why it's not happening if i'm not using a loop ? And then, how can i query a plug at a given time, in a loop ? Is there some hack, based on a setDirty or setClean call ? Is it reliable ?
Any help would be much appreciated, as i couldn't find lots of information about it online =[
Many thanks !