I was using the Visible property of a Rhino3dm layer object and I observed that the child layer remains visible even if the parent layer is off.
From the image above, the Visible property of the grid layer is False. However, for the child layers it is True.
If I select the child layers and manually turn them off then only the Visible property works as expected. Is this a planned behaviour? Is there a workaround on Rhino3dm side?
@dale, it looks like Visible (i.e. IsVisible in Rhinocommon-speak) and GetPersistentVisibility() are returning the same value for a layer, regardless of the visibility of the layer itself and its parent(s). Is this the expected behaviour?
Thanks @dale. I think the description of Layer.GetPersistentVisility() is pretty clear, but I’m still unclear on the intended behaviour of Layer.IsVisible. Should IsVisible property match what happens in Rhino?
For example, if a layer is marked as visible but its parent is not then I’d expect IsVisible to return false (and GetPersistentVisibility() would return true). What am I missing?
@dale,
Thanks for pointing that out. I was aware of the persistent visibility setting. I never tried it and I am not very clear on how to use that on child layers. This setting is for what happens to the child layers when the parent layer is turned on. But under the hood the Visible property of the child layer remains True. Which is not what I expect.
Can you share a sample of how this settings work. Do we just do layer.SetPersistentVisibility(False)?
Rhino’s layer table tries to ensure the validity of layers and their many settings. But it is certainly possible to create and/or modify layers incorrectly.
Do you have a sample 3dm file and some source code that produces layers that don’t seem to work correctly?
I would expect the Visible property to be False for Layer 01 and Layer 02.
If you had any objects on Layer 01 or Layer 02, those objects will not be visible on the rhino canvas. However, as you can see in the output, the Visible property for those layers is True. This behavior is confusing. Is it planned?