Issues with ObjectPropertiesPage for lights

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:

TestLightProps.cs (3.4 KB)

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 have logged this as a bug and am in the process of fixing it now.


The fix should be in the next 7.8 beta.

1 Like