ScriptSpot

Forum topic · General Scripting

Changing the layer of selected objects

By graphicslab · 2015-05-20

Description

I am a MAXscript noob and have done extensive searches on the subject but cannot seem to find a script which will allow me to change the layer of a selection of objects to an existing layer in the layer manager.

I have used the script listener to create the following simple script:


(
modPanel.addModToSelection (Turn_to_Poly ()) ui:on
maxOps.CollapseNodeTo $ 1 true
macros.run "Selection" "SelectInstances"
)

and would like to add script to change the layer to the current layer.

Is there anyone who can help me out?

Thanks!

Comments (1)

.

miauu · 2015-05-20

Select some objects and run the script below. The object will be moved to the currently active layer:


(
	curLayer = LayerManager.current
	for i in selection as array do (curLayer.addNode i)
)