Hi, I was wondering - is there any example code for a plugin which listens to changes in the Rhino editor, and allows real time access to tessellated geometry and light positions? I looked at the samples, but could not see anything like this. The eventual use case is to link Rhino to a VR system, enabling real-time visualization of objects created in a Rhino editing session - just looking for a starting point however. C++ preferred.
We just posted a VR sample at
I’d use the changequeue system for this if you’re targetting v6
But the VR sample is of course a better place to start.
Thanks, but where are these? I do not see them here :
The changequeue for the C++ SDK is http://developer.rhino3d.com/api/cpp/class_rh_rdk_1_1_realtime_1_1_change_queue.html A good example for its use outside of the realtime display integration doesn’t yet exist, so I’ll type one.
In short you inherit from the changequeue class, implement at least to three notification methods, and any of the ApplySomething methods you are interested in. ApplyMeshChanges, ApplyMeshInstanceChanges should get you started for the geometry.
You have to instantiate your implementation, then call its CreateWorld method on the main thread. After that you’ll probably work off the main thread.
You shouldn’t have to worry anymore about the Rhino document as the changequeue system handles changes in a centralised manner.
I’ll link the C++ example for changequeue when done, probably sometime during coming Monday.
P.s. I hope I didn’t get the method names wrong- I use the changequeue mostly through RhinoCommon with C#.
Perfect, thanks. The C++ example sounds like it’s exactly what we are looking for.
2 past midnight into the Saturday, so hang tight (:
Take your time. I probably won’t get to this seriously for at least a few weeks. Kind of nice to know you guys are interested in this and on the ball tho - so thanks for that.
I’ve typed a very simple C++ sample using the
RhRdk::Realtime::ChangeQueue meechanism, committed here:
I’ve tried to add some documenting comments on the usage of the different classes, for mesh and object/instance relations especially - see
ApplyMeshInstanceChanges in particular.
I realize the system isn’t very well documented on the C++ side, so if you feel bits and pieces remain unclear, please don’t hesitate to ask.
Some points reiterated from the code:
- ChangeQueue::CreateWorld has to be called on the main thread
- Changequeue can further be off the main thread
- No accessing of RhinoDoc in Apply* functions, since access is not on the main thread
- Flush (with apply) can be called whenever deemed necessary, one could collect more changes if wanted.
great, thanks. Will pull and look at it.