Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions adaptation of expression

  • adaptation of expression

    Posted by David Larock on September 22, 2015 at 8:59 pm

    Hey guys,

    I’m trying to create an adaptation of this expression used here – https://www.youtube.com/watch?v=4OQN2mHQuD0

    sourceLayer = thisComp.layer(“Transition Control 2”);
    sampleSize = [1,1];
    samplePoint = transform.position;
    colour= sourceLayer.sampleImage(samplePoint,samp­leSize);
    x=colour[0]*100;
    [x,x]

    It’s basically using a gradient to control the scale of a layer. What I’m trying to do is add a min and max value for the scale.

    In this tutorial, the layers are being scaled from 0 to 100.

    In my scene I have a bunch of layers at different scale values that fall from top to bottom. So I want them to scale from a smaller scale to their original scale value then back down to the smaller scale.

    Any help would be greatly appreciated! Hope that made sense 🙂

    Thanks,

    D

    sourceLayer = thisComp.layer("Transition Control 2");
    sampleSize = [1,1];
    samplePoint = transform.position;
    colour= sourceLayer.sampleImage(samplePoint,samp­leSize);
    x=colour[0]*100;
    [x,x]

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

    Kevin Camp replied 10 years, 7 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kevin Camp

    September 22, 2015 at 11:03 pm

    try this:

    sourceLayer = thisComp.layer(“Transition Control 2”);
    sampleSize = [1,1];
    minScale = 10;
    maxScale = value[0];
    samplePoint = transform.position;
    colour= sourceLayer.sampleImage(samplePoint,samp­leSize);
    x=linear(colour[0], minScale, maxScale);
    [x,x];

    set minScale to the smallest scale value that you want the layer to have. maxScale is set by the layer’s current scale value, but you could change that to a set value if you wanted (i.e., 80).

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

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