To get only positive values, you can do:
x = (your expression);
(x>0) ? x : 0; // equivalent to Math.max(x,0)
For the other part, one way is to name your first layer “LEADER”, the last in the stack: “TAIL”, add 2 nulls, one called “Lead ctrls” and the other “Tail ctrls”, then paste this expression to every item’s scale in the stack
leader = thisComp.layer(“LEADER”); leadctrls = thisComp.layer(“Lead ctrls”);
tail = thisComp.layer(“TAIL”); tailctrls = thisComp.layer(“Tail ctrls”);
linear(index, leader.index, tail.index, leadctrls.scale, tailctrls.scale);
Then adjust the 2 nulls scales. It works the same way with other transform properties.
Xavier.