Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Making Light Disappear & Reappear Behind Objects Using Expressions

  • Making Light Disappear & Reappear Behind Objects Using Expressions

    Posted by Justin Giudici on September 24, 2007 at 2:22 pm

    This is the expression I have on the flare brightness.

    target = thisComp.layer(“cloudswithalpha”);
    x = target.sampleImage(thisComp.layer(“Null 1”).transform.position, [3.5,3.5], true, time);
    alpha = x[3] * 100;
    linear(alpha, 0, 36, 80, 20)

    Layers-
    Comps- cloudsprecomp,cloudswithflare
    Solids-cloudswithalpha,lensflare,Null 1, sky

    Trent Armstrong replied 18 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Trent Armstrong

    September 24, 2007 at 2:36 pm

    YOUR ORIGINAL COMMENT WAS:
    I have a quick question about this tutorial. When I set the code in on the flare brightness it says an error occurs on line 2. The error reads class ‘ layer’ has no property or method named ‘sky’.
    Error occurred at line 2.
    Expression disabled.
    If you could help me out I would appreciate it.
    ———————————————–

    Justin,
    I copied your expression into my project and except for adjusting the name of the layer “Clouds with Alpha”, it worked fine. The expression is case sensitive with names. So that is important. But I’m not sure if that is going to solve your issue.

    I’m not sure why it was trying to reference “sky”. Would you send over your project so I can take a look? I’ll post all the information I get from it to this thread.

    Thanks,
    Trent

  • Trent Armstrong

    September 24, 2007 at 4:30 pm

    Justin,

    I noticed when I opened your project that it said it had to be up-converted from 6.5. I hate to tell you this, but the sampleImage() (and therefore the whole effect) is only available in AE 8 (CS3).

    If I am incorrect in thinking that your project is not AE 8, please let me know.

    Trent

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