how could one type an expression on a precomp layer which effects each layer inside the comp accordingly ?
i am trying to apply a fill based on depth expression to all layers inside a precomp from outside the comp.
at the momment I am applying the following to each layer inside the precomp :
c=thisComp.layer(“Camera”); // choose the active camera //
cp=c.toWorld([0,0,0]); // camera’s position in world space //
p=thisLayer.toWorld(thisLayer.anchorPoint); // this layers position in world space //
d=length(cp,p); // calculate distance from camera to layer //
far=10000; // far distance for black value //
f=linear(d,0,far,1,0); // calculate fill colour from distance //
[f,f,f,1]
if i could do this from the outside then i would not need a seperate depth comp and the depth would update according to what i do in the ‘beauty’ comp.
Jonathan Alenskas