You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have aeq.getItemsDeep to create a flat arrayEx of nested items in a folder. Having this for layers in a comp (and precomps) would be good.
Pass in a comp, get a flat arrayEx of all layers in the comp and precomps.
/**
* Returns an arrayEx of all layers in comp and precomps
* @param {CompItem} comp The comp to flatten.
* @return {aeq.arrayEx} ArrayEx with Layer objects.
*/
function getLayersDeep (comp, returnArrayEx) {
// The returnArrayEx param is so we can skip the converting to arrayEx when
// recursing. It is not meant to be used outside of this function.
var layers = [];
aeq.forEachLayer(comp, function (layer) {
if (aeq.isPrecomp(layer))
layers.push.apply(layers, getLayersDeep(layer.source, false));
else
layers.push(layer);
});
// Skip converting to arrayEx when function is called by it self.
if (returnArrayEx === false)
return layers;
return aeq.arrayEx(layers);
}
The text was updated successfully, but these errors were encountered:
Original report by Zack Lovatt (Bitbucket: zlovatt, GitHub: zlovatt).
We have
aeq.getItemsDeep
to create a flat arrayEx of nested items in a folder. Having this for layers in a comp (and precomps) would be good.Pass in a comp, get a flat arrayEx of all layers in the comp and precomps.
The text was updated successfully, but these errors were encountered: