layer list box modify
hi good freinds
i have a problem again ~
this script is layer iso list box
i would like to make multi layers iso fuction
how can i do modify this routine ?
(
layerNames = for i = 0 to (layerManager.count-1) collect (LayerManager.getLayer i).name
sort layerNames
rollout theRollout "Select By layer"
(
listBox myDropDownList items:layerNames height:50 --show more than 1 material at a time!
editText name "Layer Name :" pos:[0,670] width:139 height:17
on myDropDownList selected itm do
(
for i = 0 to (layermanager.count - 1) do
( x = layermanager.getlayer i
x.on = false
)
lay = myDropDownList.selected
test22 = layerManager.getLayerFromName lay
test22.current = on
test22.on = true
local nodes
test22.nodes &nodes
select nodes
)
)
createDialog theRollout
)--end script
Comments
.
@Obaida, could you please explain how your addition works, in other words how does the complete code look like?
Kind regards
Haider
www.haider.se
...
If 3rd radiobutton "Add" is selected : doubleclick on listed layer to add selection to selected layer
bga
.
The complete code is in the @obaida post. His version of the script adds the selected object to the clicked layer. For example:
- you have 5 layers with names Layer_01 to Layer_05 and a teapot that belongs to Layer_02
- selec the teapot and run the script
- you will see the list of the layer names in the listbox
- choose to which layer you want to move the teapot and click it.
- if you want the teapot to be moved from layer_02 to layer_04 then click the "Layer_04"
- the teapot will be moved to Layer_04 and the rollout will be closed
Tools and Scripts for Autodesk 3dsMax
...
How it works
button "Refres List" - collect (fill) listbox with current scene layer names
button "Unhide All" - unhide (turn on) all layers
states "Mode" - this tool provides two choices by doubleclick in listbox :
- select all objects in picked layer
- isolate only object in picked layer
bga
Thank you
thank you Branko for this script
i modified it to add object to layer
/*** ADD SELECTION TO LAYER ***/
try(destroyDialog ::theRollout)catch()
rollout theRollout "add obj to layer"
(
local getLay = LayerManager.getLayer, getLayN = layerManager.getLayerFromName
fn layerList = sort (for i = 0 to (layerManager.count-1) collect (getLay i).name)
listBox lb_laylist --pos:[5,90] width:170 height:17
on theRollout open do ( lb_laylist.items = layerList())
on lb_laylist selected idx do
(
node = getLayN lb_laylist.selected
For obj in selection do node.addnode obj
destroyDialog ::theRollout
)
)
createDialog theRollout style:#(#style_boarder)
Youtube, Gumroad
/*** SELECT & ISOLATE BY LAYER ***/
bga