Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects › Using the slider control and gradient ramp to only effect the x property (a series of lines)

  • Using the slider control and gradient ramp to only effect the x property (a series of lines)

    Posted by Jo Willard on June 26, 2020 at 1:27 pm

    Hi,

    I’ve stumbled across a really useful tutorial to create a halftone effect using the size controller with a gradient ramp to animate the movement:

    https://www.youtube.com/watch?v=1UaZNcVobhg

    I’d like to do this to a series of lines instead of dots but the slider control just seems to have one control for both x and y axis and not one for one or the other. I only want the width of the line effected and not the length.

    I actually got in contact with Mike the tutor to see if it was a matter of adjusting the expression but I didn’t understand what he sent!

    The expression in the tutorial placed on the shape’s scale property is:
    x = thisComp.layer(“Gradient”).sampleImage(transform.position, [.5,.5]/2, true, time)[0];100*[x,x]

    Mike said adding [0] to the end.

    [0] x property
    [1] y property
    [2] z property

    but end of where? It didn’t work by putting it at the end of the expression.

    Is anyone able to help? Thanks so much for reading my waffle!!!

    Jo

    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.

    Jo Willard replied 6 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Graham Quince

    June 27, 2020 at 9:16 am

    Looking at the expression, I think what you’re after is to adjust the X scale, but not the Y scake. Mike used a little bit of a shortcut, which I think is the source of your confusion. If I rewrite the expression, it might be clearer:


    x = thisComp.layer("Gradient").sampleImage(transform.position, [.5,.5]/2, true, time)[0];
    y = x;
    100*[x,y];

    If you only want the X scale to be adjust and have y be a fixed scale:


    x = thisComp.layer("Gradient").sampleImage(transform.position, [.5,.5]/2, true, time)[0];
    y = value[1];
    100*[x,y];

    This picks up the current . user specified value for Y, but leaves X to be whatever you want. Now Mike has also used a 100*[x,x] in his expression, which might be easier to write as:


    x = thisComp.layer("Gradient").sampleImage(transform.position, [.5,.5]/2, true, time)[0]*100;
    y = value[1];
    [x,y];

    This way you’ll only be multiplying X by 100 and leaving Y to the value you set.

    http://www.YouTube.com/ShiveringCactus – After Effects Tutorials

  • Jo Willard

    June 27, 2020 at 11:57 am

    Perfect! Thank you so much Graham! I still don’t understand how expressions work and would never have been able to figure this out but you gave me the answer. Appreciate your time.

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