I think this will distribute a property between two layers named “Start Layer” and “End Layer” (change the first two lines if your bookend layers have different names):
startLayerName = "Start Layer";
endLayerName = "End Layer";
sStr = 'thisComp.layer("' + startLayerName + '")';
eStr = 'thisComp.layer("' + endLayerName + '")';
sIdx = eval(sStr + '.index');
eIdx = eval(eStr + '.index');
p = thisProperty;
str = ".value";
while(!(p instanceof Layer)){
str = '("' + p.name + '")' + str;
p = p.propertyGroup(1);
}
sVal = eval(sStr + str);
eVal = eval(eStr + str);
linear(index,sIdx,eIdx,sVal,eVal)
It assumes that the layers are contiguous in the layer stack, with “Start Layer” at the top and “End Layer” at the bottom.
Dan