ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Adding + wiggle to the final value somehow messes the expression.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Edson Junior
Adding + wiggle to the final value somehow messes the expression.
on Jul 14, 2020 at 9:48:36 pm

Hi, im making an expression so i can trigger animations i made with keyframes that are located between markers using a expression with a slider, from 0 to 100.
Im using a checkbox just in case i want to invert the rotation value.
this is the expression for the rotation value.

code that works:
chkBx = effect("MONITOR A INVERT ROTATION")("Checkbox");
s = thisComp.layer("MOVEMENT VJ").effect("MONITOR A MOVE")("Slider");
m = thisComp.layer("MOVEMENT VJ").effect("MONITOR A MOVEMENT TYPE")("Menu")
m1= thisComp.marker.key(m).time;
m2= thisComp.marker.key(m+1).time;
t = linear(s,0,100,m1,m2);
v = valueAtTime(t)
if (chkBx == 1)
v*-1
else
v


So far so good. This is working as intended.
However i want to add the capacity of wiggling the rotation of the object in question, controling the amount with a slider
it messes up the expression and what i get is not the actual expected result from the slider as if the expression is working but the actual value of the keyframes in the timeline + the wiggle.


code that doesnt work:
chkBx = effect("MONITOR A INVERT ROTATION")("Checkbox");
lev = wiggle(0.5,linear(effect("MONITOR A LEVITATE")("Slider"),0,100,0,3))
s = thisComp.layer("MOVEMENT VJ").effect("MONITOR A MOVE")("Slider");
m = thisComp.layer("MOVEMENT VJ").effect("MONITOR A MOVEMENT TYPE")("Menu")
m1= thisComp.marker.key(m).time;
m2= thisComp.marker.key(m+1).time;
t = linear(s,0,100,m1,m2);
v = valueAtTime(t)+lev
if (chkBx == 1)
v*-1
else
v


I have tried variations of the above code,
such as, trying to just add the wiggle to the valeu in the end.
trying to add a simple (0,0) wiggle, and it still messes the expression up.

Any one know any possible reason for this?


Return to posts index

Dan Ebberts
Re: Adding + wiggle to the final value somehow messes the expression.
on Jul 15, 2020 at 1:50:54 pm

wiggle() always includes the value of the property, so try changing this:

lev = wiggle(0.5,linear(effect("MONITOR A LEVITATE")("Slider"),0,100,0,3))

to this:

lev = wiggle(0.5,linear(effect("MONITOR A LEVITATE")("Slider"),0,100,0,3)) - value;


Dan



Return to posts index

Edson Junior
Re: Adding + wiggle to the final value somehow messes the expression.
on Jul 22, 2020 at 2:19:56 am

Thanks alot, that worked! ☺

Stuck with another problem however, been looking in the forums couldnt find a solution.
Im fully rigging a bunch of animations so i can mix them all up and render into a bunch of vj loops.
But got stuck when trying to rig this loop that animates in up to the point a slider hits 10 and then it keeps looping.
I also would need the animation going off. So somehow the code need to animate it off from wherever % it is at that loop time to 0.

I already have the entire animation rigged in a slider that animates in from 0 to 50 and fits a perfect loop from 50 to 100.

Now i need another slider that controls this one following the behavior i want.

Any ideas i could look into?


Return to posts index


Filip Vandueren
Re: Adding + wiggle to the final value somehow messes the expression.
on Jul 22, 2020 at 10:15:32 am

You want to keyframe up to 10, then have it continue automatically ?
That could be done with loopOut()

I would make second slider for the "Fade Out", animate this from 1 to 0 and multiply the previous slider with that one.
something like:


loopOut() * effect("End")("Slider");


But it really depends on exactly what's going on, to understand what you mean by "animate it off" and what kind of transition/values that would need to create?



Return to posts index

Edson Junior
Re: Adding + wiggle to the final value somehow messes the expression.
on Jul 22, 2020 at 4:46:42 pm

So, the idea is to make an infinite zoom loop like this:







but to make it start from nothing (0%) and control the loop animating in, stay looping until the slider is up, and then animating out when the slider goes down. Thats the idea.
Didnt think about multiplying the loopout with a constant. Will try that.

Thanks


Return to posts index

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