Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions offset values when using slider? NOOB

  • offset values when using slider? NOOB

    Posted by Fred Gates on January 29, 2013 at 4:52 pm

    Hi I have a noob question, I’m pickwhiping an item to a slider control that has a range of 0 to 25 and the item itself has an x postition of 1640, as soon as I apply the expression the item relocates to the left edge of screen or 0.0.

    how can I get things to stay in there original locations?

    thanks in advance

    Jim

    senior animator
    MGV London

    Fred Gates replied 13 years, 3 months ago 3 Members · 3 Replies
  • 3 Replies
  • Kevin Camp

    January 29, 2013 at 5:21 pm

    if you want to keep the values relative to the current value, you’ll want to change the expression to add the slider value to the current value (that sounds more complicated than it is):

    try this:

    xOffset = effect(“Slider Control”)(“Slider”);
    value + [xOffset,0]

    to explain the last line a bit, since value for position is an array [x,y], when you want to add a value to it, that value will need to be expressed as an array too.

    if your position value is in 3d [x,y,z], then you’ll need to add another dimension to the second array [xOffset,0,0]

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Dan Ebberts

    January 29, 2013 at 5:23 pm

    What’s the role of the slider? Did you want to add it to the layer’s x position? That would look like this:

    s = effect(“Slider Control”)(“Slider”);
    value + [s,0]

    In any case, “value” gives you the pre-expression value of the property.

    Dan

  • Fred Gates

    January 29, 2013 at 5:57 pm

    Thanks guys, This has helped me out a ton.

    cheers

    Jim

    senior animator
    MGV London

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