function LayerScript(moho)
count = moho.document:CountLayerComps()
print(count)
for i = 0, count - 1 do
local comp = moho.layerComp(i)
print(comp:Name())
end
end
Right now it doesn't find moho.layerComp. How do I acces the class LayerComp?
function LayerScript(moho)
--Add layer to the same layercomp as the parent layer----------------
---------------------------------------------------------------------
layer = moho.layer
local myID = moho.document:LayerID(layer)
local myParent = layer:Parent()
if not(myParent == nil)then
comp = moho.document:GetLayerComp(myID)
count = moho.document:CountLayerComps()
for i = 0, count - 1 do
local comp = moho.document:GetLayerComp(i) --Search through all layercomps. If the parent layer is inside, add this layer to it.
if(comp:ContainsLayer(myParent))then
if not(comp:ContainsLayer(layer))then
print("Layer added to Layercomp: ", comp:Name())
comp:AddLayer(layer)
end
end
end
end
--END of Add layer to the same layercomp as the parent layer----------------
---------------------------------------------------------------------
end