Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Transform Expression

  • Transform Expression

    Posted by Rory Burke on November 18, 2015 at 8:20 am

    Pretty much I have been trying to link the scale effect within transform (in an adjustment layer) to a slider.

    I have got the other effects to work with the slider correctly, but the scale seems extremely choppy – and isn’t a fluid transition between a high scale to a lower scale, or vice versa.

    To summarize the choppiness, it’s basically only changing when it hits a real (like 1,2,3 etc.), and not a float/decimal (like 0.5, 1.5, 2.5 etc.).

    Thanks in advance!

    This is my current code: (Please note that the OR operators are for linking the transform to other sliders – for efficiency)

    (slider = effect("Scale")("Slider"));
    linear(slider,0,4,[100],[104])

    | linear(effect("Scale w/ Best Shake")("Slider"),0,4,100,104)

    | linear(effect("Scale w/ Vertical Shake")("Slider"),0,4,100,104)

    Kalleheikki Kannisto replied 10 years, 10 months ago 3 Members · 5 Replies
  • 5 Replies
  • Kalleheikki Kannisto

    November 18, 2015 at 8:52 pm

    An OR operator usually compares true and false values (0 and 1) and returns true or false (0 or 1) so I assume there is a problem using it on slider values. AE probably has no idea what you are trying to do. It doesn’t evaluate only the one that has changed, if that is what you are trying to do. What is the result of 0.576 OR 1.476 OR 3.786? I have no clue and I doubt AE does either.

    I’d get the three slider values separately and tell AE what you want to do with these three values. Do you want to use the maximum value or the minimum value from the three possible values, or their average, or their sum or something else.

    —

    Update: AE thinks the result of 0.576 OR 1.476 OR 3.786 is 3. Which I gather to be the result of the calculation 0 OR (1 OR 3), however that gets evaluated.

  • Rory Burke

    November 22, 2015 at 6:33 pm

    I’m getting confused of what you are trying to tell me.

    This expression is assigned to the scale of the transform effect.

    Basically, there are three sliders – scale, scale w/ best shake, and scale w/vertical shake.

    I am assigning this single scale effect so if I move any of those three sliders, the scale will also move accordingly.

    No, this isnt going to a single slider.

    Thanks in advance,
    Rory

  • Rory Burke

    November 22, 2015 at 6:36 pm

    So 1.2 on one of them, and 2.4 on another would mean that the scale would total to 3.6 on the transform effect.

    I’m doing OR because its a matter if I do this slider, OR this slider, OR this slider, do this.

    I managed to fix this by using three transform effects – each that are assigned to their own slider.

    It works, but I would prefer for it to be done with only one transform effect, makes it abit less over complicated.

  • Dan Ebberts

    November 22, 2015 at 8:02 pm

    I think you just need something like this:

    effect(“Scale”)(“Slider”) +
    effect(“Scale w/ Best Shake”)(“Slider”) +
    effect(“Scale w/ Vertical Shake”)(“Slider”) +
    value

    Dan

  • Kalleheikki Kannisto

    November 23, 2015 at 9:39 am

    The point was that AE doesn’t evaluate only the slider that changes value, it evaluates all three. So you end up with the logical operation (OR) between the outputs of all three slider values, NOT the output of a single slider.

    Hence, you need to tell AE what you want to do with all three slider values, i.e. you need a mathematical operation with the three value, not a logical operation. (I was trying to explain what the result of the logical operation between the values would be.)

    If you want just one of the sliders to affect the transform, you will need a selector that tells which one. OR doesn’t do that. Another slider with the value 1, 2 or 3 could be used to determine which slider’s value you want.

    Now, if you really want to try and do what you describe without adding another slider, the way to select one of the three slider values would be a While loop that checks backward in time frame by frame for all three slider values to see which of the three slider values was changed most recently, and you would then use only that slider’s value. It can be done, but I can’t recommend this approach as it will likely slow down rendering.

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