-
toComp needed?
I have this expression controlling the opacity of a layer…
C = thisComp.activeCamera;
startFade = 0;
endFade = 100;
d = length(toWorld(anchorPoint),C.toWorld([0,0,0]));linear(d,startFade, endFade, 20,80)
… to control the opacity based on how far away the camera is to the layer. it works fine with the camera in the same comp. i then wanted to use this same expression inside a precomp, but refrencing the same camera in the main comp. so i went into the precomp, selected the opacity of the layer i wanted to control, pasted the expression and changed it to this…
C = comp(“Map”).activeCamera;
startFade = 0;… etc…which isnt working. Im guessing it has something to do with the toWorld part, and it might need toComp in there somewhere since the camera is not in the precomp.
suggestions? thanks!