Simple layer script
Hey guys,
Sorry to keep posting simple little questions. I am trying to learn maxscript but I keep getting stuck on dumb little things.
I want a script that will loop through a selection and move the objects to a new layer with the layer name matching the object name. But also change the wire color to colors inside of a defined array.
So object 201.MDL:brck will be moved to a newly created layer named "201.MDL:brck"
with the wire color matching the first color in the "sColor" array. And so on and son.
The way I have it written now, the script will create and move the objects to the new layers. But the colors are all the same. It won't cycle through the array and move on to the next color.
__________________________________________________
sColor = #(red, green, blue, yellow, brown, orange)
(
for o in selection do
(
oName = o.name
oLayer = LayerManager.newLayerFromName oName
for c in sColor do
(
oLayer.wirecolor = c
)
oLayer.addNode o
)
)
___________________________________________________
Comments
...
Optimized version
bga
Is there anyway for the clrID
Is there anyway for the clrID to loop to the next color so I don't have to manually change that number?
...
bga
Works great!!! Thank you!
Works great!!! Thank you! Still got a lot to learn.
...
Use integer value for "clrID" argument. This number represent ordinal number of item in sColor array
bga