Great expression Tom; thanks! There’s just a couple typos in there that I fixed so people can just copy/paste:
a = thisComp.layer(this_layer,-1).transform.position[0];
b = thisComp.layer(this_layer,1).transform.position[0];
c = (a+b)/2;
d = thisComp.layer(this_layer,-1).transform.position[1];
e = thisComp.layer(this_layer,1).transform.position[1];
f = (d+e)/2;
g = thisComp.layer(this_layer,-1).transform.position[2];
h = thisComp.layer(this_layer,1).transform.position[2];
i = (g+h)/2;’>i = (g+h)/2;
[c, f, i]