This is a feature request related to the native SUOverlayRefs implementation.
We (and I would assume many other integrations leveraging SUOverlayRefs) recieve updates on artitrary threads and with to invalidate the view. Currently this is only available via the ruby api (Sketchup::View#invalidate) but because SketchUp's ruby api can only be executed safely on the main thread we have to defer or post this to the main thread. Something like:
deferrer->post([](void*) {
rb_eval_string("Sketchup.active_model&.active_view&.invalidate");
}, nullptr);
This is not optimal.
- post to main thread
... wait for main thread to execute ruby
- execute ruby, invalidating the view
... wait for main thread to redraw overlays
- redraw overlay
There should be some thread safe way to invalidate the view for the overlay.
This is a feature request related to the native SUOverlayRefs implementation.
We (and I would assume many other integrations leveraging SUOverlayRefs) recieve updates on artitrary threads and with to invalidate the view. Currently this is only available via the ruby api (Sketchup::View#invalidate) but because SketchUp's ruby api can only be executed safely on the main thread we have to defer or post this to the main thread. Something like:
This is not optimal.
... wait for main thread to execute ruby
... wait for main thread to redraw overlays
There should be some thread safe way to invalidate the view for the overlay.