Hey Marsel,
After a few more test I noticed something strange about the callback. It seems to fire a lot (400-600 times) after I'm done moving the viewport. This makes my plugin do all the viewport changed related stuff even when the viewport isn't moving anymore. I'm guessing this is not normal?
I ve tried both RegisterViewportDisplayCallback and RegisterRedrawViewsCallback both do the same thing... This is how I implemented it:
class rvCallback : Autodesk.Max.Plugins.RedrawViewsCallback
{
int count = 0;
public override void Proc(IInterface ip)
{
++count;
IGlobal global = Autodesk.Max.GlobalInterface.Instance;
global.TheListener.EditStream.Wputs(count.ToString() + Environment.NewLine);
global.TheListener.EditStream.Flush();
}
}
var myCallback = new rvCallback ();
iface.RegisterRedrawViewsCallback(myCallback);
I run this is max and rotate the viewport untill the 'count' is about 100, then I stop rotating/moving the viewport but the 'count' keeps going up until 600-700. Is this something I can fix?
Thanks,
Vin