-
Opacity based on distance from Camera: multiple nested compositions
I have three comps, each nested in the previous:
MASTER > Scene1 > SongsRow1
Inside SongsRow1, there is a layer called “test” that I’d like to fade out as it pulls a certain distance away from the camera.
I am having trouble using “toWorld” to navigate all these nested comps… I’m still not 100% clear on how “toWorld” works. This is what I have (in the opacity field of layer “test”):
startFade = thisComp.layer("controls").effect("startfade")("Slider");
endFade = thisComp.layer("controls").effect("endfade")("Slider");
C = comp("MASTER").activeCamera.toWorld([0,0,0]);
P = comp("MASTER").layer("Scene1").toWorld(comp("Scene1").layer("SongsRow1").toWorld(thisComp.layer("test").anchorPoint)); // This is where the problem is, I think
d = length(C,P);
linear(d,startFade,endFade,100,0)Thanks!