Notifications
Clear all

[Closed] layer grouping

i use max9
i made some code with other friends ,sorry

that is layers grouping , all each layer objects is grouped with each layer’s name
that did not work , can you help pls

(

for i = 0 to layerManager.count-1 do
(
ilayer = layerManager.getLayer i
layerName = ilayer.name
layer = ILayerManager.getLayerObject i
for n in (refs.dependents layer) do

   (
   group n name:layerName
   )

)

)--end script
5 Replies

This is what you looking for

		for m = 0 to layerManager.count-1 do
  		(
  			layer = layerManager.getLayer m
  			layer.current = true
  			layerName = layer.name
  			layer.nodes &theNodes
  			if theNodes.count > 1 do group theNodes name:layerName ; free theNodes
  		)
2 Replies
(@dussla)
Joined: 11 months ago

Posts: 0

i tested that
but each layers’ object not group
what problem ?

(@gazybara)
Joined: 11 months ago

Posts: 0

Previous code create a group of all layer nodes.
But you want this

for m = 0 to layerManager.count-1 do
(
	layer = layerManager.getLayer m
	layer.current = true
	layerName = layer.name
	layer.nodes &theNodes
	if theNodes.count != 0 do 
	(
		for obj in theNodes do group obj name:layerName
		free theNodes	
	)
)

Why do you need this?
Last time I created two scripts that you request on scriptspot.com.
But this…I do not know what you need.
You need to know that Layer Manager can’t show groups.

yes second script is my wanted script
really thank you
that work well