When adding a custom object properties page for lights, I find some apparently glitchy behavior, which differs depending what we return for PageType, and whether the (render) plugin is set as current renderer.
In short, when returning Light and the plugin is not current renderer, the behavior is what I would call desirable – Rhino remembers that we were looking at our custom page when a new selection is made, and we have a button for our page, and are able to switch between our page, and e.g. the main ‘Object’ properties page.
When we return Light and are the current renderer, the button for our custom page is removed, and it is possible to switch to the ‘Object’ page, but not back to ours – we must make a new selection, which will be shown in our page, as opposed to the ‘Object’ page we had just shown.
And when we return Custom for PageType, then each new selection of lights causes the Rhino ‘Light’ page to be shown, regardless if we had switched to our custom page for the prior selection.
These behaviors are observed in 7.7.21160.5001, 2021-06-09 (not yet checked mac), and are also outlined in comments in this small test file:
There are several object pages that are optionally replaceable and tied to the current render plug-in, these are two that come to mind:
Materials
Lights
The intent is that if you plug-in registers a page with one of these types and is the current plug-in then you are queried when it is time to display your page, if you are not the current render plug-in then your page should not display. It is important to note that your page has the opportunity to look at the selected object list and decide if it wants to participate. For example you have have a way to tag an object as a light emitter or use some kind of custom light in which case you can tell Rhino to display the light page even though no core Rhino light objects are selected.
That being said, I’m not sure what happens if you change the current render plug-in while your light page is selected. I would expect the properties system to reinitialize the page list and display the page based on the new render plug-in. If your light page appears as a button in the property navigation control when your plug-in is not the current render plug-in then that is a bug.
Thanks John, but I think it cannot be considered a bug, nor disallowed or even discouraged, for a render plugin’s property page to be shown when it is not current, since viewports may be using its display mode.
Here’s a video showing my issue, where when I am current renderer, the user loses the ability to select my page:
This is showing the first two cases I outlined above, where the plugin is returning Light for PageType.
I must reiterate that I disagree with the idea that current renderer alone should control which obj props pages are shown; maybe this tooltip from my renderer’s light properties page will help explain
it is not absolutely required that the rhino light page become inaccessible, but in order to prevent it, I would have to use a PropertyPageType that yields a poor experience; here are the behaviors of the four combinations of PropertyPageType and current renderer
PropertyPageType.Light, with rhino current – my light properties are not shown
PropertyPageType.Light with bella current – rhino’s light properties are not shown
PropertyPageType.Custom with rhino current – constantly have to re-select my properties
PropertyPageType.Custom with bella current – constantly have to re-select my properties
so, obj props could be taught to quit jumping back to the light page every time a new selection is made, and I could return PropertyPageType.Custom; however this would be a hack, and not address the core issue
which is: rhino should not decide what to show in obj props based on current renderer alone, when it allows any renderer to be used in any viewport, at any time – in addition to current renderer, it should enumerate the viewports and include obj props pages for any actively-rendering render plugins