ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Wiggle expression between 2 values only

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jane Cassidy
Wiggle expression between 2 values only
on Dec 6, 2010 at 12:33:42 pm

I hope I'm not reposting, I just can't find the answer anywhere. Basically I want to switch a layer on and off randomly.

In order to do this I've added a wiggle expression to the opacity. This works but I need it only to use the values 0 and 100. Is there a way to have it only use these values or do I need to approach this issue differently?

Thank you.


Return to posts index

Michael Szalapski
Re: Wiggle expression between 2 values only
on Dec 6, 2010 at 2:35:47 pm

You'll want the result from your wiggle to be a variable and then use that variable in an if then statement.

- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')

No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.


Return to posts index

Dan Ebberts
Re: Wiggle expression between 2 values only
on Dec 6, 2010 at 5:57:56 pm

Just set the value to 50 and add an expression like this:

wiggle(1,50) < 50 ? 0 : 100


Dan



Return to posts index


Jane Cassidy
Re: Wiggle expression between 2 values only
on Dec 6, 2010 at 11:19:02 pm

I got it to work. Thanks a million for your help. Much appreciated.


Return to posts index

Nithish kumar
Re: Wiggle expression between 2 values only
on Apr 26, 2020 at 3:27:13 pm

Can you explain the syntax of this expression ? Cause I've seen numbers inside the parenthesis of wiggle expression. Not outside.


Return to posts index

Dan Ebberts
Re: Wiggle expression between 2 values only
on Apr 26, 2020 at 3:35:47 pm

It basically says if the wiggled value is less than 50, set the result to 0, otherwise set it to 100.

ThE ?/: syntax is an example of the JavaScript ternary operator, which is a compact form of if/else.


Dan



Return to posts index


Nithish kumar
Re: Wiggle expression between 2 values only
on Apr 27, 2020 at 7:04:03 am

Thank you so much, Dan..It was of great help as always......


Return to posts index

Nithish kumar
Re: Wiggle expression between 2 values only
on Apr 27, 2020 at 7:05:43 am

Thank you so much, Dan..It was of great help as always...

Is there any detailed tutorial for Ternary operator that you can point me to.....?


Return to posts index

Dan Ebberts
Re: Wiggle expression between 2 values only
on Apr 27, 2020 at 7:32:54 am

There's not much to it really, this should cover it:

https://www.javascripttutorial.net/javascript-ternary-operator/


Dan



Return to posts index


Nithish kumar
Re: Wiggle expression between 2 values only
on Apr 28, 2020 at 7:59:40 am

Thank you soo much. Will Go thru it.....


Return to posts index

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