How to know when my veiwport render pipeline was activated and deactivated

Hello

Is there any event that fires when my pipeline is activated and deactivated via viewport menu

In the C++ sample I’ve found it starts to render at the start up, but it’s of cause not a good approach, we want to render only when our render is active

When a render plug-in is activated or deactivated, the plug-ins’s CRhinoRenderPlugIn::OnSetCurrentRenderPlugIn() override is called. At this time, you should enable or disable whatever you need to.

Does this help?

Not quite, I need to know when my custom “display mode” is selected by user in this menu

when it’s selected I need to start my custom progressive viewport rendering and when user selected some other display mode then I need to stop my viewport rendering

it’s all about this sample https://github.com/mcneel/Rhino5Samples_CPP/tree/master/SampleViewportRenderer

In this sample viewport starts to render at start up and keep render even if is not active(actually if inactive it renders but does not present output in the viewport)

Use the CRhinoDisplayModeChanged event watcher. Let me know if you need an example.

Thanks, but could you provide some sample code with how to use it?

I’ve updated the SampleViewportRenderer so as to demonstrate how to use a CRhinoDisplayModeChanged event watcher.

Thanks Dale, this helped to solve the issue