Code: Select all
local layerList
moho.document:CountSelectedLayers(layerList)
Moderators: Víctor Paredes, Belgarath, slowtiger
Code: Select all
local layerList
moho.document:CountSelectedLayers(layerList)
Ah, thanks! Hmm but how do I access the selected layers? CountSelectedLayers doesn't tell me which layers are selected.synthsin75 wrote:CountSelectedLayers does not populate the empty variable. You need to assign it a variable:
local selLayerCount = moho.document:CountSelectedLayers(moho.document)
You can also specify a particular group layer instead of the whole document.
To count through them:
for i=0, moho.document:CountSelectedLayers(moho.document)-1 do
lehtiniemi wrote:Ah, thanks! Hmm but how do I access the selected layers? CountSelectedLayers doesn't tell me which layers are selected.
Code: Select all
for i=0, moho.document:CountSelectedLayers(moho.document)-1 do
local layer = moho.document:GetSelectedLayer(i)
Thanks!!!synthsin75 wrote:lehtiniemi wrote:Ah, thanks! Hmm but how do I access the selected layers? CountSelectedLayers doesn't tell me which layers are selected.Code: Select all
for i=0, moho.document:CountSelectedLayers(moho.document)-1 do local layer = moho.document:GetSelectedLayer(i)