Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions sample from left

  • Posted by Robert Paynter on December 9, 2009 at 9:28 pm

    I’m using the expression below on numerous layers’ opacity so that the value is driven by a ramp. Right now I think it is sampling the ramp from the layers anchor point. How can change this to reflect a position to the layers most left? (also all the layers are different sizes and shapes)

    min = [0];
    max = [100];
    l = thisComp.layer(“Ramp”);
    p = l.fromComp(toComp(anchorPoint));

    v = rgbToHsl(l.sampleImage(p))[2];

    linear(v, 0, 1, min, max);

    Robert Paynter replied 16 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 10, 2009 at 3:16 am

    Try changing this line:

    p = l.fromComp(toComp(anchorPoint));

    to this:

    p = l.fromComp(toComp([0,height/2]));

    Dan

  • Robert Paynter

    December 10, 2009 at 3:20 pm

    Perfect. Thanks Dan.

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