In the RH8 WIP I’m having trouble making some of my sublayers visible. When I open a model, I only have a few key layers turned on, but I want to turn on all layers and sublayers. When I go to the Layer toolbar > All Layers On, it does not turn on the “Model On”, so it remains invisible in my perspective view.
I also use a python script to turn on/off certain sublayers, but it doesn’t work to modify “Model On” either.
def RunCommand( is_interactive ):
rs.EnableRedraw(False)
layers = rs.LayerNames()
if layers:
for layer in layers:
if "LayerName" in layer.lower():
rs.LayerVisible(layer,False,False)
rs.EnableRedraw(True)
I have not done much layout work recently, so I don’t have an opinion about the effectiveness of this additional layer control, but already struggle with it during normal modelspace work.
I tried to export part of the file so that I could share publicly, but that exported file didn’t have the same problem. I did send the full file your way.
The new Model On column is intended for those who work with layouts. But it’s good to know how the column works in case you get files from others.
As you know, the On column in the Layers panel controls layer visibility. If a layer is off, then it is off everywhere. But if a layer is on, it can be turned off (overridden) in layout/detail views. This is really helpful when setting up layouts for printing.
Once you get your layouts set up, you need to tread lightly with layer visibility because turning off a layer turns it off everywhere, which can adversely effect the layouts you worked so hard to configure.
The Model On column get around this problem. If a layer is on, then it can be turned off (overridden) in model views. This allows you to continue to work on your model without effecting the layouts you’ve created.
Note, there is no support for layer model visibility in rhinoscriptsyntax, as it was designed to mimic legacy RhinoScript.
This sample script turns layers and removes any model visibility override.
import Rhino
import scriptcontext as sc
for layer in sc.doc.Layers:
# Turn layer on
if not layer.IsVisible:
layer.IsVisible = True
# Turn layer on in model views, if overridden
if not layer.ModelIsVisible:
layer.ModelIsVisible = True
sc.doc.Views.Redraw()
Dale,
Your explanation is helpful, but I’m not sure the initial question was answered. Why doesn’t the All Layers On override the Model On for many of the sublayers in the file I sent? It appears to work when I build a file from scratch.
This turns all layers on; the equivalent of select all layers, in the Layers panel, and clicking in the On column. Since the model on property was not overridden, the lightbulb lights up too.
That’s right. The All Layers On only turns the layer back on. If the Model On property was previously overridden, it will remain so. Essentially, the button was what it did in early Rhino versions.
I guess another part of the discussion would be how does the Model On work with layerstates? Before saving my file, I typically enable a layerstate called Save so that it turns off all the layers with the construction curves. The next time I open the file, I want to turn on all the layers, but it doesn’t work because they were turned off from the layer state.
I don’t like it. I think all layers on should override the Model On setting, but that’s just me and my workflow.
Me and my office has been pushed McNeel to add more functionality for Layouts and you guys certainly have delivered, so that is not my frustration.
Sorry to put my opinion so bluntly, but I don’t think anyone anticipates exceptions when they ask Rhino to turn All Layers On. Unless there is a different command or button that allows me to turn on everything in the perspective viewport, I am suggesting that this may sometimes cause confusion.
If you guys like it as is, that’s fine, your suggestions for the python script is very helpful and I can rely on that to make the visibility function for my own needs.