ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Alternate change the x,y size.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Andrei Popa
Alternate change the x,y size.
on Feb 5, 2019 at 7:41:16 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.


Return to posts index

Tomas Bumbulevičius
Re: Alternate change the x,y size.
on Feb 5, 2019 at 11:29:18 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.


Return to posts index

Dan Ebberts
Re: Alternate change the x,y size.
on Feb 5, 2019 at 2:15:31 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



Return to posts index


Andrei Popa
Re: Alternate change the x,y size.
on Feb 6, 2019 at 11:52:58 am

Precisely what i was looking for. Thanks, Dan.

Andrei
My Envato portfolio.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]