Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Dan Ebberts Light Falloff & Digieffect Light Falloff Plug-in

  • Dan Ebberts Light Falloff & Digieffect Light Falloff Plug-in

    Posted by Chris Trollen on December 14, 2009 at 9:32 pm

    Hi,

    I downloaded a trial version of the Digieffects light falloff plug-in (https://www.digieffects.com/product/falloff_lighting) and played around with it but was not entirely satisfied with the results (I am new to After Effects so it could be me in the way I set up the layers and I may be looking for something that is not fully possible in AE).

    I wanted to compare it with the expression that Dan Ebberts wrote for light falloff utilizing the Diffuse & Specular material properties https://www.motionscript.com/design-guide/falloff.html, and I was wondering if anyone knows how to adapt this expression for more than one light in a scene – it is completely beyond my very basic knowledge of expressions.

    Any help, guidance and input would be great.

    Many thanks

    Chris

    decay = .005;
    noFalloff = 200;

    L = thisComp.layer("Light 1");

    d = length(L.transform.position,transform.position);
    if (d < noFalloff){
    value;
    }else{
    value/Math.exp((d - noFalloff)*decay);
    }

    Eoin Ryan replied 14 years, 6 months ago 5 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    December 14, 2009 at 10:49 pm

    Something like this maybe:

    decay = .005;
    noFalloff = 200;
    accum = 0;
    for (i = 1; i <= thisComp.numLayers; i++){ if (index == i) continue; try{ thisComp.layer(i).lightOption.intensity; L = thisComp.layer(i); d = length(L.transform.position,transform.position); if (d < noFalloff){ accum += value; }else{ accum += value/Math.exp((d - noFalloff)*decay); } }catch(err){ continue; } } Math.min(accum,value) Dan

  • Chris Trollen

    December 14, 2009 at 11:29 pm

    Mr. Ebberts,

    This is terrific! – I just tried a quick test and it looks like it will be just the thing I needed.

    Thank you very much for going to the trouble to do this (and I am stunned at how quickly!)

    Regards,

    Chris

  • Michael Szalapski

    December 16, 2009 at 8:07 pm

    The Ebberts is astonishing that way.

    – The Great Szalam
    (The ‘Great’ stands for ‘Not So Great, in fact, Extremely Humble’)

    No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.

  • Paul Belliveau

    January 15, 2010 at 7:56 pm

    Hi Dan,

    First, thanks for cranking out these solutions. I tried to cut and paste the above “multiple light” solution into the diffuse property and AE returned this error:

    After Effects warning: Expected: ;
    Expression disabled

    Error occurred at line 5.

    Does this make sense to you? FWIW, I’m using CS3.

    Thanks,
    Paul

  • Eoin Ryan

    October 28, 2011 at 10:59 am

    Hello,

    I was wondering if this expression works when applied to a nested comp. Should the layers within the comp respond to the expression? I’ve tried applying it and it doesn’t seem to have any effect.

    Thanks,
    Eoin

    Intel Mac, AE CS4.

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