Notifications
Clear all
[Closed] Get the index of an object's layer
Apr 15, 2011 11:04 am
Hi all,
I’m pretty sure this hasn’t been discussed here, I would like to get the index of a layer…
Like a
$.layer.index
Of course it doesn’t work… :wise:
Any idea ?
2 Replies
1 Reply
Of course... So obvious. Thanks. Here is the code :
fn getLayerIndex obj =
(
if (IsValidNode obj) then
(
layerList = for i = 0 to layermanager.count-1 collect #( i, (layerManager.getLayer i).name)
for i = 1 to layerList.count do
if (finditem layerList[i] obj.layer.name) != 0 then return layerList[i][1]
)
else return "Invalid Node"
)