Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › An odd BUG in the AE expressions drove me nut

  • An odd BUG in the AE expressions drove me nut

    Posted by Mehdi Rafeie on September 1, 2013 at 12:58 pm

    Hi all (specially Dan!)

    Did you know that Javascript engine of “AE CS 6” cannot detect ‘7’ nor ’14’ number in ‘y’ component of a ‘Point’?!!!

    Assume there is a text layer which has an expression effect of type Point. (Let me name it “P” and set it to [6, 7].) Now, insert the following code for the Source Text of this layer.

    if (thisLayer.effect("P")("Point").value[1] == 7)
    "YEP";
    else
    "Cannot detect 7 number!";

    Mehdi Rafeie replied 13 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    September 1, 2013 at 4:25 pm

    I’m not seeing that behavior, but it might depend on how you’re setting the value. I wouldn’t set up a test that way, because as I recall, Point Controls get some spatial interpolation (like position keyframes), so I would do it more like this:

    if(Math.abs(effect(“Point Control”)(“Point”)[1] – 7) < .001)
    “YEP”
    else
    “NOPE”;

    Dan

  • Mehdi Rafeie

    September 3, 2013 at 6:11 am

    Thanks a lot Dan!

    In my case, I used an expression effect of type ‘Point’ to hold ‘table cell index’ value in my project and the workaround I used is as follows. Anyway, thanks for your attention.

    var cellIndex = thisLayer.effect("P")("Point");

    var i = parseInt(cellIndex[0]);
    var j = parseInt(cellIndex[1]);

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