Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Easy stop roller

  • Posted by Davib Le roux on August 29, 2009 at 3:54 pm

    I am having serious trouble making my animation ease from one value to the next.
    I have a layer (called “Numbers”) containing numbers and logos arranged something like this:

    LOGO
    2
    LOGO
    LOGO
    4
    LOGO
    3
    0
    LOGO
    6
    7
    LOGO
    1
    8
    LOGO
    5
    9
    LOGO

    (sorry, didint know how to attach a picture of the layer.)

    this layer moves behind a “window layer” that only allows one number or logo to be displayed at a time. like a slot machine display. so in other words to change the value in the window i must edit the y value of my Numbers layer.

    To do this i have added a slider control to another layer (FaceValue) and used an expression. so if my slider control value is any whole number between 0 and 9, that number will be visible in the “window”. if the slider value is anything other than a whole number between 0 and 9, the value will be moving (wiggle(0.2,10000).

    to animate it i have keyframed the slider values. at 0:00:00 the slider value is 10 and at 0:02:00 the value is the number i want to display (eg 5 or 8 or any number 0-9).

    the problem i have is that the animation goes from wiggling at 50 000 pixels per second, to stopped, without slowing down. i want it to slowdown to a stop. Like a slot machine would do. just dont know how to write the expression. i was thinking a time related expression would help but im no good at expresions. please help.

    x = thisComp.layer("FaceValue").effect("SliderControl")("Slider")
    if (x == 1){
    400+34
    }
    else if (x == 2){
    233.3+34;
    }
    else if (x == 3){
    838.3+34;
    }
    else if (x == 4){
    131.3+34;
    }
    else if (x == 5){
    -299.7+34;
    }
    else if (x == 6){
    -36.7+34;
    }
    else if (x == 7){
    1011.3+34;
    }
    else if (x == 8){
    -472.7+34;
    }
    else if (x == 9){
    578.3+34;
    }
    else if (x == 0){
    -124.7+34;
    }
    else if (x == 10){
    -182;
    }
    else if (x == 11){
    346;
    }
    else if (x == 12){
    -639;
    }
    else if (x == 13){
    90;
    }
    else if (x == 14){
    -813;
    }else{
    wiggle(.2,10000);
    }

    Filip Vandueren replied 16 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Filip Vandueren

    August 31, 2009 at 2:20 pm

    You’re just wiggling to get motion blur ?

    That’ll never work he way you want.

    The easiest way I can think of is to use the offset effect.

    place your layer so it’s centered behind your “window”.
    Apply the distort->offset effect.
    Change the y-value of the offset untill your first logo is in the right position it should be [layerwidth/2 , -slotheight] if that makes sense.

    Add two sliders to this layer named:
    visible slot
    (set this to 1)
    revolutions

    now apply this expression to the offset “shift center to”:

    numSlots=18;
    h=source.height;

    visibleSlot=effect("visible slot")("Slider");
    revolutions=effect("extra revolutions")("Slider");

    y=-(visibleSlot-1)*(h/numSlots)-(h*revolutions);

    value+[0,y]

    Okay, now you can just keyframe from visible slot 1 to visible slot 8 or whatever, and the right one should be in the window.

    next step: motion blur.
    Add a fast blur or box blur set to vertical only and add this expressino to blur amount:

    effect("Offset")("Shift Center To").speed/25*thisComp.shutterAngle/360;

    but we still need to add extra revolutions to sell the effect. Just keyframe the revolutions slider in whole numbers, every time you kayframe from 1 slot to the next.

    It can be done with an expression too, but that’s a bit more comples, and probably slower to render.

    Let me know if this makes sense to you.

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