Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Checkbox controlling 2 different sets of array possibilities – Error

  • Checkbox controlling 2 different sets of array possibilities – Error

    Posted by Jason Hearne on February 3, 2012 at 8:10 pm

    I’m trying to control the position of null based on if it’s being controlled by a slider or not.

    If it’s controlled by the slider – It moves.
    If it’s not controlled by the slider it returns to it’s default position and does not move.

    I get the “Dimension error” 1 instead of 3

    I’m searching all over the place and I can’t figure out why this does not make sense?!?!

    control = effect("Checkbox Control")("Checkbox") ;
    xoffset=thisComp.layer("Camera Controls").effect("Mosaic Mover X")("Slider")*30;
    yoffset=thisComp.layer("Camera Controls").effect("Mosaic Mover Y")("Slider")*20;
    x=parent.position.value[0];
    y=parent.position.value[1];
    z=parent.position.value[2];

    if (control == 0){
    [x+xoffset,y+yoffset,z];
    }else{
    [x,y,z];
    }

    Jason Hearne
    EdenFX
    Visual Effects and Animation

    Paul Roper replied 14 years, 4 months ago 2 Members · 4 Replies
  • 4 Replies
  • Paul Roper

    February 3, 2012 at 8:17 pm

    Not sure, but try removing the semicolons fro the end of the [x+xoffset,y+yoffset,z]; and [x,y,z]; lines. I might be wrong, but it’s worth a shot.

    – Paul

  • Jason Hearne

    February 3, 2012 at 10:04 pm

    Yeah, I thought of that prior to posting. Just tried it again to make sure I wasn’t crazy… yup, not crazy.

    sigh

    Jason Hearne
    EdenFX
    Visual Effects and Animation

  • Jason Hearne

    February 3, 2012 at 10:25 pm

    Holy Guacamole!!!

    I was putting it on the wrong layer….

    I reduced it to 1 dimension like it was asking for, and once I no longer got the error, I could not change the value. That’s when I knew I had it on the wrong layer… ugh.

    Thanks anyway, Paul.

    J

    Jason Hearne
    EdenFX
    Visual Effects and Animation

  • Paul Roper

    February 3, 2012 at 10:32 pm

    Hmm….I’ve just tested that expression and it doesn’t generate any errors for me – it evaluates OK, but I’m not sure exactly what you’re trying to achieve by it. If you want the checkbox to control whether or not the………………….

    ….ah – just seen you’ve solved it!

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