ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Apply "posterizeTime()" on only one part of an expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Remi Monedi
Apply "posterizeTime()" on only one part of an expression
on Nov 15, 2018 at 9:57:22 am
Last Edited By Remi Monedi on Nov 15, 2018 at 9:59:32 am

Hi everyone, here again with probably an impossible question :

I combined 2 expressions (loopOut and wiggle) and I'd like to apply the expression "posterizeTime()" only to the wiggle expression (this is an example).
Is it possible? My tests with "posterizeTime()" ended with everything AFTER it being temporally posterized. So I was wondering if somehow it could be limited to only one expression (within a variable maybe?).

Have a nice day!


Return to posts index

Kalleheikki Kannisto
Re: Apply "posterizeTime()" on only one part of an expression
on Nov 15, 2018 at 2:35:39 pm

Any value can be "posterized" using the Math.floor expression. The exact method depends on what you're doing. Most likely the valueAtTime() is involved. For example, to posterize something to happen 5 times per second in a 25 fps comp, this works for many properties:

valueAtTime(Math.floor(time*5)/5)

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Remi Monedi
Re: Apply "posterizeTime()" on only one part of an expression
on Nov 15, 2018 at 3:14:21 pm

Thank you Kalleheikki! I did find this trick too but the "posterizeTime()" expression is just simpler this is why I was wondering if it was possible to apply it only on one part of an expression?


Return to posts index


Alex Printz
Re: Apply "posterizeTime()" on only one part of an expression
on Nov 15, 2018 at 4:38:18 pm

yeah, all you have to do is declare the posterizeTime between the different calculations, and then recombine. This will wiggle the X position at comp framerate, and this will wiggle the Y at 1 per second:

X = wiggle(2,50);
posterizeTime(1);
Y = wiggle(2,50);
[X[0],Y[1]]


Alex Printz
Mograph Designer


Return to posts index

Remi Monedi
Re: Apply "posterizeTime()" on only one part of an expression
on Nov 16, 2018 at 3:36:10 am
Last Edited By Remi Monedi on Nov 16, 2018 at 3:40:49 am

Thank you Alex but what if I want to apply a different "posterizeTime()" to each wiggle (like in your example)?
This won't work obviously, the first "posterizeTime()" influencing the second :

posterizeTime(3);
X = wiggle(3,500);
posterizeTime(30);
Y = wiggle(3,500);
[X[0],Y[1]]


Return to posts index

Dan Ebberts
Re: Apply "posterizeTime()" on only one part of an expression
on Nov 16, 2018 at 4:31:27 am

You could do something like this:

p = 1/3;
t = p*Math.floor(time/p);
x = wiggle(3,500,1,0.5,t)[0];
p = 1/30;
t = p*Math.floor(time/p);
y = wiggle(3,500,1,0.5,t)[1];
[x,y]


Dan



Return to posts index


Remi Monedi
Re: Apply "posterizeTime()" on only one part of an expression
on Nov 16, 2018 at 4:55:57 am

Thank you Dan, I guess I have my answer :

It's not possible to apply several "posterizeTime()" to different part of an expression without the first one bypassing the others.

I did find an old answer from you Dan (2012) with more or less the same code you wrote here ;)


Return to posts index

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