Notifications
Clear all

[Closed] Exclude all nested layers within a specific layer


fn setAllLayersOn state = 
(
   for k=0 to layerManager.count-1 do (layerManager.getlayer k).on = state
)
fn getNestedLayers layer layers:#() = 
(
   append layers layer
   for k=1 to layer.getnumchildren() do getNestedLayers (layer.getchild k) layers:layers
   layers
)
fn setLayerOn name state nested:on = 
(
   if (layer = layerManager.getLayerFromName name) != undefined do 
   (
      if nested then (getNestedLayers layer).on = state 
      else layer.on = state
   )
)
setAllLayersOn on
setLayerOn "MainLayer" off nested:on 

Almost there

This works, almost. When I say, exclude switching “Mainlayer” and its nested layers on, I meant to ignore it no matter what the current state is.
So not switching them on, doesnt mean switching them off, just need it to be ignored or excluded from any operation

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

it will be your homework

Page 2 / 2