Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Parent lens flare centre

  • Kim Ranzani

    May 20, 2009 at 12:09 pm

    Simply 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 pm

    Yes, 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 pm

    Try this for your lens flare’s center:

    p = thisComp.layer(“Null 1”).transform.position;
    d = valueAtTime(0) – p.valueAtTime(0) ;
    p + d

    Dan

  • Dan Ebberts

    May 20, 2009 at 3:57 pm

    I 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 pm

    This 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 am

    Hey 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 am

    I’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 am

    I 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.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy