The following code works when running it on a Switch layer but on all other kind of folder-layers I get the lua-error;
Code: Select all
... attempt to call method 'CountLayers' (a nil value)
Code: Select all
local parent = moho.layer
local numberlayers = moho.layer:CountLayers() --Here's the line lua has troubles with.
local j = 0
--parse through all child layers
for i= 0, numberlayers - 1 do
moho:SetSelLayer (parent:Layer(j))
print (moho.layer:Name())
j =j+1
end
end