Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Can Dan Ebberts Light Falloff work on Layers within Nested Comps?

  • Can Dan Ebberts Light Falloff work on Layers within Nested Comps?

    Posted by Eoin Ryan on October 28, 2011 at 11:05 am

    Hello,

    I’m trying to get light falloff on layers within a nested comp, it’s a succession of objects in z-space which a camera with a parented light moves past. I precomped the objects as there are dozens of them, does anyone know if it possible to get Dan’s expression to work on them by applying it to the precomp?

    I have a fairly limited understanding of expressions!

    Thanks,
    Eoin

    Intel Mac, AE CS4

    Eoin Ryan replied 14 years, 6 months ago 2 Members · 4 Replies
  • 4 Replies
  • Eoin Ryan

    October 28, 2011 at 11:18 am

    Also, I’ve just realised this expression doesn’t work when you move the light past the object, only when you move the layer past the light. It’s probably a big ask but does anyone have a solution for this as well?!

    Thanks,
    Eoin

  • Dan Ebberts

    October 28, 2011 at 8:25 pm

    Assuming that the comp with the light is named “Main” and that your sub-comp is a 3D layer in the main comp with Collapse Transformations turned on, this should work:


    M = comp("Main");
    L1 = M.layer("Light 1");
    decay = .005;
    noFalloff = 200;
    P2 = toWorld(anchorPoint);
    L2 = M.layer(thisComp.name);
    d = length(L1.toWorld([0,0,0]),L2.toWorld(P2));
    if (d < noFalloff){
    value;
    }else{
    value/Math.exp((d - noFalloff)*decay);
    }

    A better solution is probably to upgrade to AE CS5.5, which has built-in light falloff.

    Dan

  • Dan Ebberts

    October 28, 2011 at 8:27 pm

    What’s the issue, exactly? What behavior were you expecting?

    Dan

  • Eoin Ryan

    October 31, 2011 at 11:07 am

    Thanks for that Dan, it worked!

    Yes I think an upgrade to CS5 might be in order but this will do nicely for now,

    Thanks again,

    Eoin

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