Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Adding + wiggle to the final value somehow messes the expression.

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

    Posted by Edson Junior on July 14, 2020 at 9:48 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?

    Edson Junior replied 6 years, 2 months ago 3 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    July 15, 2020 at 1:50 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

  • Edson Junior

    July 22, 2020 at 2:19 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?

  • Filip Vandueren

    July 22, 2020 at 10:15 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?

  • Edson Junior

    July 22, 2020 at 4:46 pm

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

    https://www.youtube.com/watch?v=Q4RTWl63YAM

    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

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

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