Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Affecting parameters based on gradient map

  • Affecting parameters based on gradient map

    Posted by Tom Holmes on December 22, 2014 at 10:09 am

    Hey Guys!

    Im not sure if these is an expression problem but he’s my enquiry.

    I would like to affect the scale (or other parameter) of an object based on a gradient map under neither it. Is there some what of tell a layer what colour pixels it is sitting on top of/under neither?

    Heres an example of how this will be used. A comp filled with small individual squares arranged in a grid on the comp. A B&W gradient layer where a small strip of white pixels animates across the screen and where the gradient goes from black to white the squares will scale from 0 to 100, creating a wave of scaling squares across the screen and the white strip animates.

    Am i shooting in the dark?

    Thanks Guys!

    Tom

    Xavier Gomez replied 11 years, 4 months ago 4 Members · 3 Replies
  • 3 Replies
  • Todd Kopriva

    December 22, 2014 at 5:42 pm

    You can use the sampleImage expression method to tell what the color at a point is.

    https://blogs.adobe.com/aftereffects/2009/07/color-sampler-using-sampleimag.html

    ———————————————————————————————————
    Todd Kopriva, Adobe Systems Incorporated
    After Effects product manager and curmudgeon
    After Effects team blog
    ———————————————————————————————————

  • Kevin Camp

    December 22, 2014 at 6:35 pm

    you can use sample Image() to help with this:
    target = thisComp.layer("gradient"); // this is the layer to sample
    sMin = 10; // min scale for the square
    sMax = 100; // max scale for the square
    radius = .5; // sample radius

    smpl = target.sampleImage(position,[radius,radius], true, time)[0];
    s = linear(smpl, sMin, sMax);
    [s,s]

    just change the target layer name to your gradient layer’s name and use the layer. note that you may need to precomp your gradient layer(s) depending on how you are creating the gradient map. then apply the expression to all the squares.

    you can also use an effect like card wipe. it will divide up a layer into a grid of ‘cards’ and then allow you to control the ‘card’ attributes with a gradient. if you choose you gradient layer as ‘gradient layer 1’ and set the x and y scale attributes to use ‘intensity 1’ for the source, .5 for the multiplier and .6 as the offset it may start to get you close.

    trapcaode’s particular can do this too if you have it. harry frank has an old tutorial that you could adapt to use square particles:

    https://www.motion-graphics-exchange.com/after-effects/Particular-Halftone-Effect/4a872de7c592c

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Xavier Gomez

    December 22, 2014 at 9:33 pm

    Just in case, there is also a ready-made solution on aescripts.com:
    https://aescripts.com/ae-shader-effector/

    Xavier.

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