Notifications
Clear all

[Closed] Duplicate Layer with the same content inside

First run this fn

fn cloneLayers prefix: sufix: hidden:off =
(
	  for l = 0 to layerManager.count-1 where (lay = layerManager.getLayer l).ishidden == hidden do
	  (
		  if (nodes = refs.dependentNodes lay.layerAsRefTarg).count != 0 do
		  (
			str = filterstring lay.name "_"
			  if prefix != unsupplied do str[1] = prefix
			  if sufix != unsupplied do str[str.count] = sufix
			newname = str[1] ; for i = 2 to str.count do newname+="_"+str[i]
			  maxops.clonenodes nodes expandHierarchy:on cloneType:#copy actualNodeList:&an newNodes:&nn
			  newlayer = layermanager.newLayerFromName newname
			  for n in nn do newlayer.addNode n
		  )
	  )
)

And then tray next:
note: this works on all unhiden layers
#1 if jou want to change sufix only then


 cloneLayers sufix:"nurbs"
 

#2 if jou want to change sufix only then


 cloneLayers prefix:"new"
 

#3 if jou want to change both


 cloneLayers prefix:"new" sufix:"nurbs"
 

#4 if jou want to change both on hidden layers only


 cloneLayers prefix:"new" sufix:"nurbs" hidden:on
 
Page 2 / 2