Copy link to clipboard
Copied
Hi
i'm creating an own lensfare.I have created all elements and i'm struggling with the position expression of the iris elements.
Can anyone point me in the right direction how to create the following expression=>
Example:When i move the source point of the flare to the right i want certain elements move to the left accordingly,like the build in Lensflare in after effects does.You know what i mean.Well,just pickwhiping and add *-1 doesn't really work.
any help appreciated
Copy link to clipboard
Copied
Assuming your main flare element is a layer named "flare", an expression like this will position a layer on the line that goes through the flare and the center of the comp window. Adjust "mult" to set how far, relative to the distance between "flare" and the center. -1 puts it the same distance but on the other side. 0.5 would put it on the same side but half as far. You'll see...
mult = -1;
flare = thisComp.layer("flare");
compCenter = [thisComp.width,thisComp.height]/2;
compCenter + mult*(flare.toComp(flare.anchorPoint) - compCenter);
Dan
Copy link to clipboard
Copied
Hi dan
Thank you very much.It works of course ;-).
Any chance to make it work in 3d as well?
Copy link to clipboard
Copied
It's hard to picture how that would work, but you might play around with this, which keeps everything relative to the camera's POI:
mult = -1;
flare = thisComp.layer("flare");
center = thisComp.layer("Camera 1").transform.pointOfInterest;
center + mult*(flare.toWorld(flare.anchorPoint) - center);
Dan
Copy link to clipboard
Copied
Hi there,
Yep,it works but Orientation looks a bit strange.Layers always look at the 3d world center.
cheers