Activity › Forums › Adobe After Effects Expressions › Parent lens flare centre
-
Parent lens flare centre
Posted by Amit Zinman on May 20, 2009 at 5:50 amHi,
I have a null with some tracking information. I would like to move the lens flare center according to it.
What expression could I use to to parent a property rather than the entire layer?Amit
Chris Dasinger replied 10 years, 11 months ago 5 Members · 8 Replies -
8 Replies
-
Kim Ranzani
May 20, 2009 at 12:09 pmSimply alt+click on the stopwatch of the property you want to link (in this case the flare center) and then link it with the pickwhip to the tracking data (position) of your null…
bye!
-
Amit Zinman
May 20, 2009 at 1:20 pmYes, that’s nice but not really satisfying as following the position is not really the same thing is a following an object with an anchor point and rotation values. Also, it gives the position values of the null rather that follow the changes in them.
-
Dan Ebberts
May 20, 2009 at 2:52 pmTry this for your lens flare’s center:
p = thisComp.layer(“Null 1”).transform.position;
d = valueAtTime(0) – p.valueAtTime(0) ;
p + dDan
-
Dan Ebberts
May 20, 2009 at 3:57 pmI think this might be more what you’re after:
L = thisComp.layer(“Null 1”);
p = L.transform.position;
r = L.transform.rotation;
d = valueAtTime(0) – p.valueAtTime(0);
angle = degreesToRadians(r – r.valueAtTime(0));
s = Math.sin(angle);
c = Math.cos(angle);
x = d[0]*c – d[1]*s;
y = d[0]*s + d[1]*c;p + [x,y]
This is a pretty cool expression actually. Thanks for the inspiration.
Dan
-
Amit Zinman
May 20, 2009 at 4:23 pmThis looks pretty cool. Thanks!
I hope that future flare effects will have a “follow this layer” option, like some 3D effects have.Amit
-
Filip Vandueren
May 21, 2009 at 2:36 amHey Dan,
can you explain why this Lensflare expression is not possible with a layerspace transfrom ? I’m not following I think.
-
Dan Ebberts
May 21, 2009 at 2:45 amI’m assuming he was using tracking data that included rotation, like you’d get if you track two corners of something. My hunch was that he wanted the lens flare center to maintain the same offset from the object – including rotation so that it would appear that the flare is actually parented to the object. The rotation was the tricky part.
Dan
-
Chris Dasinger
June 15, 2015 at 3:29 amI signed up on this site just to say THANK YOU, DAN EBBERTS! This has been driving me nuts for hours. It almost appears to be easier with Video Copilot’s flare effects, but I don’t want to spend money on those right now.
Reply to this Discussion! Login or Sign Up