[Closed] how to Isolate a Layer
Hi,
I want to ask a question
How to Isolate a Layer use maxscript ?
Thanks
Do you mean if you have for example 25 layers in the layer manager and you only want the current layer visable, but you dont want to hve to manually check each layers hidden state?
if that is the case then this for loop will set only the current layer as unhidden and the rest to hidden.
for L = 1 to LayerManager.count do
(
layer = (layermanager.getlayer (L – 1))
if layer.current == true then layer.ishidden = false else layer.ishidden = true
– if layer.current == true then layer.isfrozen = false else layer.isfrozen = true
)
Cheers
Dan Lane
Thanks
I mean
I have a layer , name is “a”. It is not current layer, I want to isolate “a”
How to do ?
Second quetion ,how to select all object in the “a” layer?
Something like this:
fn selectNodesInLayer layerIndex = (
if layerIndex >= 0 and layerIndex < LayerManager.count do (
local layerRef = (LayerManager.getLayer layerIndex).layerAsRefTarg
local nodesInLayer = #()
if (layerRef.nodes &nodesInLayer) do (
select nodesInLayer
)
)
)
HTH.
Not sure if this is the best way but it works:
for[color=#fffffe] L = 1 to LayerManager.count [color=#fffffe]do
[/color][/color][size=1](
layer = (layermanager.getlayer (L – 1))
if layer.name == “a” then layer.ishidden = false else layer.ishidden = true
)
[/size]