Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Alternate change the x,y size.

  • Alternate change the x,y size.

    Posted by Andrei Popa on February 5, 2019 at 7:41 am

    Hello community/. I am trying to change the size of a layer, but alternating between x and y, not both at the same time. Some kind of wiggle, but i need the x to be static while y modifies and viceversa. I hope this is possible to achieve.

    Andrei
    My Envato portfolio.

    Andrei Popa replied 7 years, 3 months ago 3 Members · 3 Replies
  • 3 Replies
  • Tomas Bumbulevičius

    February 5, 2019 at 11:29 am

    Hey Andrei,

    assuming you are talking about the size change, its about scaling?

    Anyways, below is an example how you could affect X scaling transformation only – but similar applies to any 2D array scenario. It could be done in a few ways, but this one is the clearest for myself.

    (Instead of ‘transform.scale[0]’ you could simply add ‘value[0]’ of that particular property)

    sX = transform.scale[0];
    sY = transform.scale[1];

    newX = 15; //Or slider value attached to this variable

    [newX, sY]

    Find out more:
    After Effects Tutorials: motion design, expressions, scripting.

  • Dan Ebberts

    February 5, 2019 at 2:15 pm

    This is a little rough, but maybe something like this:

    period = 1;
    amp = 50;
    freq = 3;

    seg = Math.floor(time/period);
    ph = seg%2 ? period : time%period;
    t = Math.floor(seg/2)*period + ph;
    seedRandom(index,true);
    wx = wiggle(freq,amp,1,0.5,t)-value;
    ph = seg%2 ? time%period : 0;
    t = Math.floor(seg/2)*period + ph;
    seedRandom(index + 1009,true);
    wy = wiggle(freq,amp,1,0.5,t)-value;
    value + [wx[0],wy[0]]

    Dan

  • Andrei Popa

    February 6, 2019 at 11:52 am

    Precisely what i was looking for. Thanks, Dan.

    Andrei
    My Envato portfolio.

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