Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression Error: Expression result must be of dimension 2, not 1 …

  • Expression Error: Expression result must be of dimension 2, not 1 …

    Posted by Paul Connors on October 9, 2019 at 1:55 pm

    Hi Guys. I’m getting an error on a position expression control that says: “Expression result must be of dimension 2, not 1 … ”

    I have a slider that goes from 1-5. I’m trying to move the position controller based on the number in that slider.


    numSlider = effect("Number of Slider")("Slider");
    x = 960;
    if (numSlider == 5) {(x,418)} else {(x,540)}

    Currently I have the slider set to 5 so I could test my expression. It didn’t work. Ha. I really can’t see any reason why this shouldn’t work though. It’s giving me the error at Line 1 as if it thinks I want the variable “numSlider” to be the output.

    Any help would be greatly appreciated. Thanks.

    Mathieu Morfin replied 5 years, 10 months ago 4 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    October 9, 2019 at 4:05 pm

    You need square brackets instead of parens:

    numSlider = effect(“Number of Slider”)(“Slider”);
    x = 960;
    if (numSlider == 5) {[x,418]} else {[x,540]}

    Dan

  • Paul Connors

    October 9, 2019 at 7:42 pm

    As always … thanks very much Dan!

  • Mathieu Morfin

    September 19, 2020 at 5:16 am

    Hi there.

    I have the same error message with a slightly different code. :

    transform.position

    fps=5

    spd=1000

    posterizeTime(fps), time*spd

    I tried to change parens in line 4 with square brackets but it didn’t work.

    Its telling me the error is in line 1 though.

    I’m trying to get a feeling of twitchy animation of a set moving in the background of my vidéo.

    Thanks in advance if you can help.

    Mathieu.

  • Filip Vandueren

    September 19, 2020 at 3:07 pm

    Hi Mathieu, you didn’t use semicolons to end statements, maybe that’s why you get an error in line 1.

    The result of your calculation has 1 dimension, a number.

    In what direction do you want the layer to move?

  • Mathieu Morfin

    September 19, 2020 at 5:47 pm

    Thank you for your answer.

    I find another way to solve my problem. I don’t know if it can be useful for others but in case of :

    I did it by “separating dimensions” of the position parameter for my layer/compo and then alt+clic to add the expression : posterizeTime(10); value+time*200

    10 : if the number of frame per second. The smaller the number the more twitchy it gets.

    value refers to the previous value you put in your position parameter

    200 is the number you change to have you end position set correctly.

    Thanks for your help anyway.

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