Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions AE still reading a commented-out expression

  • Dan Ebberts

    July 14, 2009 at 11:15 pm

    Fair enough. I’d love to see the exact expression that’s generating the “No matching closing brace found” error though.

    Dan

  • Joe Laude

    July 14, 2009 at 11:15 pm

    Maybe I should emphasize that I did add in a line that did get the portion above it to resolve to a value, then I commented out the rest of it. Then I got errors, and I didn’t have errors before. I removed the commented lines, leaving the rest unchanged, and it worked without error. To me, After Effects should look at an expression with commented lines and the same expression with those commented lines completely omitted as the exact same thing, and one was giving me errors while the other was not. That’s what I mean.

  • Joe Laude

    July 14, 2009 at 11:33 pm

    This is the 4-line expression I’m using now in it’s entirety, and it’s not giving me errors:

    p=comp(“Pre-comp 2”).layer(“MovingPlate”).transform.position;
    x=p[0]+transform.position[0];
    y=p[1]+transform.position[1];
    [x,y];

    As I’m sure you can tell, it’s just meant to parent the position of a layer in the main comp to another layer within a pre-comp, and allow an offset.

    To check that the array, p, was receiving the correct values from “Pre-comp 2,” I added “[p[0],p[1];” between lines 1 and 2, and commented out the remaining 3 lines. Like this:

    p=comp(“Pre-comp 2”).layer(“MovingPlate”).transform.position;
    [p[0],p[1]];
    //x=p[0]+transform.position[0];
    //y=p[1]+transform.position[1];
    //[x,y];

    That gave me an error. At first, I was wondering what I did wrong (whether [p[0],p[1]] was valid syntax-wise, and questioning my memory as to whether this was the correct way to comment in AE). I deleted those commented lines, like so:

    p=comp(“Pre-comp 2”).layer(“MovingPlate”).transform.position;
    [p[0],p[1]];

    That worked, so I knew there wasn’t a problem with the code. I proceeded to check the manual about comments, tried commenting both ways, with “//” and “/*” and both gave me different errors. I can see why commenting out the whole expression would make AE mad, but not 3 lines when the rest works on it’s own.

    Due to that pre-comp and the main comp starting on different frames, these values were off from what I was expecting. I didn’t catch that right away, so that’s why I checked the values going into the expression first. It’s working, so again, it’s not a big deal. This strange behavior simply tripped my curiosity.

  • Dan Ebberts

    July 14, 2009 at 11:37 pm

    I just copied and pasted your error producing version:

    p=comp(“Pre-comp 2”).layer(“MovingPlate”).transform.position;
    [p[0],p[1]];
    //x=p[0]+transform.position[0];
    //y=p[1]+transform.position[1];
    //[x,y];

    into AE and it doesn’t generate any errors for me.

    Dan

  • Joe Laude

    July 15, 2009 at 1:12 am

    Like I’d expect, so you can understand my confusion 🙂 Could it be a version thing? I’m using AE 9.0 on OS X Tiger 10.4.11 on this workstation. All the other machines I use have the most recent updates of AE and Leopard, so maybe it’s a bug, unique to this combination or something. Weird.

  • Filip Vandueren

    July 15, 2009 at 1:15 pm

    What happens when you end the expression with:

    [p[0],p[1]];

    After the comments?

Page 2 of 2

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