[Closed] layer isolater button making
there is layer manager for layer work
but that is not complex to me
i heat my head
that is to making 2 layer isolater script button
first button : from first layer on and other hide
second buttone : from last button work ,
ex)
ther is 7 layers
using first button , i work till 3 layers
if i put this button , i start from forth layer
i don;t know language skill well
pls can you explain well
It would probably be easier to make a floating window list view. This would allow multiple selections with an isolate layers at the bottom. That way it would work with any scene and any number of layers, without having to worry about hard coding layers into the script.
Once you collect the needed layers all you need to do is set their ishidden value to true (hidden) or false (unhidden). Here is a quick sample, but a UI will have to be written for it.
-- layers index is 0-based so 0 to 2 will modify the first 3 layers. 0-index layer will always be 0 (default).
-- NOTE: Layer order is determined by the order in which they are created, not the current order in the manager.
-- this will hide the first 3 layers
for val in 0 to 2 do (
(layermanager.getLayer val).isHidden = true
)
-- this will unhide the last 4 layers
for val in 3 to 6 do (
(layermanager.getLayer val).isHidden = false
)
-Eric
thank you for reply
but above is only example
26 layers , 50 layer s etc …
if i put first button , first layer iso and the others is hiden
again if i put first button put , second layer iso ,the others is hiden
.
.
.
pls , can you undetstand my situation ?
this is what i understood from ur last post. Have a look if this is what u want.
(
try (destroyDialog showLayer) catch()
global showLayer
rollout showLayer "Show Layer"
(
local _lyrNo = 0
spinner spn_LayerNo "Layer No: " range:[1,layerManager.count,1] type:#integer
button btn_Show "Show Layer" width:115 height:35
on spn_LayerNo changed val do _lyrNo = (val-1)
on btn_Show pressed do
(
for i = 0 to layerManager.count-1 where i != _lyrNo do
(
(layermanager.getLayer i).isHidden = true
)
(layermanager.getLayer _lyrNo).isHidden = false
)
)
createDialog showLayer
)
thank you for your effort really really
that is good
(layermanager.getLayer _lyrNo).isHidden = false
_lyrNo += 1
i add this statement
but there is error
pls can you help again ?
thank you really
i modified some.
but that is error
pls can you fix them ?
(
try (destroyDialog showLayer) catch()
global showLayer
global start
rollout showLayer “Show Layer”
(
local _lyrNo = 0
spinner spn_LayerNo “Layer No: ” range:[1 ,layerManager.count,1] type:#integer
button btn_Show “Show Layer” width:115 height:25
on spn_LayerNo changed val do _lyrNo = (val-1)
on btn_Show pressed do
(
for i = 0 to layerManager.count-1 where i != _lyrNo do
(
(layermanager.getLayer i).isHidden = true
)
(layermanager.getLayer _lyrNo).isHidden = false
local thislayername = layermanager.getLayer i
if ( layerManager.count != _lyrNo )
(
_lyrNo = _lyrNo + 1
spn_LayerNo.value = _lyrNo
)
else (
_lyrNo = 3
spn_LayerNo.value = _lyrNo
)
)
)
createDialog showLayer
)
I completely skipped over the post where Akram posted his code and realized I was posting the same thing :P.
Yeah you’ll need to explain what you were trying to change and why.
An alternative way to work it out, just select the objects on the layers to isolate and call the built in isolate function
i modified code
if you excute them , you can find error
if i put button till layer’s number , that code say error
i want to return as first layer if i put after puting total layers numbers
exameple ) layers numbers 17 layers
if i put button till 17 numbers without adjusting spinner continuely ,
code work well
but after after 17 , that is error
i want to return frist 1 layers