Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Flipside expression error

  • Flipside expression error

    Posted by Andy George on July 1, 2010 at 10:38 pm

    Using Mr. Eberts’s flipside expression in CS4

    I keep getting the following error:

    After Effects warning: layer to comp matrix isn’t invertible in toCompVec
    Expression disabled.

    Error occurred at line 1.
    Comp:”Comp 1″
    Layer “8(“At Least.Comp1”)
    Property: Opacity

    The expression is applied to a precomposed text layer which is parented to a null rotating on the Y axis.
    I use expression often and I can’t figure out what Im doing differently here.

    Thanks
    Andy

    if (toCompVec([0, 0, 1])[2] > 0 ) value else 0

    Teague Chrystie replied 9 years, 11 months ago 5 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    July 1, 2010 at 11:50 pm

    I don’t think I’ve ever seen that error before. Does the error only happen at certain rotations, or do you always get it as soon as you enable the expression? Any way you can post or send the project?

    Dan

  • Andy George

    July 2, 2010 at 7:36 pm

    Hi Dan,

    Thanks for your time.

    There is only 1/2 rotation on the null. Basically just flipping a layer to reveal another layer behind it.

    The expression seems to work if I enable it while the current time indicator is
    a few seconds into the comp.
    Once I move the time indicator to the start of the timeline, I get the error.

    Here is an AEP-

    https://www.chiselindustries.com/Client/lottery.zip

    Thanks

    -Andy

  • Dan Ebberts

    July 2, 2010 at 7:47 pm

    Ah, OK. When the scale of the layer is zero, the toCompVec() operation doesn’t have anything to work with. Try this variation to defend against that condition:

    if ((Math.abs(scale[0]) > .001) &&( toCompVec([0, 0, 1])[2] > 0 )) value else 0

    Dan

  • Andy George

    July 2, 2010 at 7:52 pm

    Works like a charm!

    Thanks again

    -Andy

  • Eliezer Cisner

    January 22, 2014 at 6:11 am

    And how to I apply this fix to a nested comp (camera’s in parent comp)?

    My current expression:

    parentComp = comp("Parent Comp");
    parentLayer = parentComp.layer(thisComp.name);
    if(parentLayer.toWorldVec(toWorldVec([0,0,1]))[2] > 0) value else 0

  • Kevin Barnum

    November 25, 2015 at 6:44 pm

    This didn’t work for me in CC. Turns out AE doesn’t like such a small value for the scale check condition. Changed it to the following and I no longer get expression errors.

    if ((Math.abs(scale[0]) > 0.01)&&( toCompVec([0, 0, 1])[2] > 0 )) value else 0

  • Teague Chrystie

    May 23, 2016 at 4:08 pm

    Just in case anyone else stumbles across this error and finds this page among the lonesome handful of Google results, I was experiencing this issue as well, and while protecting the Scale from low values seemed to work alright sometimes, ultimately my issue was solved by making sure that there’s never a point in the comp where my error-prone layer wasn’t active. In other words, the layer that had my expression on it was shorter than the actual comp, and when the layer ceased to “exist” the expression got mad. Making that layer longer than the comp seems to resolve it.

    Good luck, folks.

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