Does Rhino raise any kind of event when attributes from the current viewport are changed?

rhinocommon

(Alonso Rosado) #1

Let us say that, for example, I change the orientation and focal point of the viewport. Does Rhino raise an event I can subscribe to anywhere? The closest thing I’ve found is the RhinoView’s set active event.

P.D: I’m aware of the existance of the changequeue and that I could overload it to get access to the ApplyViewChange function, but I’dl like to know if it’s possible to avoid the changequeue entirely.


(Nathan 'jesterKing' Letwory) #3

There is no separate event available for these. Focal blur related events request is logged as RH-42257. I’ll add a link to this topic to the report.

In C++ the way to track camera changes there is this guide: http://developer.rhino3d.com/guides/cpp/tracking-camera-changes-with-conduits/ - The RhinoCommon sibling DisplayConduit looks a bit different, but you can do essentially the same, where you implement one of the events where you place your tracking code. See for instance http://developer.rhino3d.com/samples/rhinocommon/display-conduit/ for a simple DisplayConduit sample.

Implement say PreDrawObject, construct a ViewInfo from the RhinoViewport from the event, and check the focalblur related settings. For camera info directly use the RhinoViewport given in the event argument.


(Alonso Rosado) #5

Well thank you @nathanletwory! That looks promising. Thanks also for adding this post to the report. I found it wierd that on such a strongly event based system such as rhino there wasn’t any event raised in such cases! So its really nice to know its on a TODO list :blush: