Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions TypeError: this.sourceRectAtTime is not a function

  • TypeError: this.sourceRectAtTime is not a function

    Posted by Adam Haas on October 17, 2018 at 6:34 pm

    I’ve been using the following code for over a year:


    layerTop = this.sourceRectAtTime().top;
    layerLeft = this.sourceRectAtTime().left;
    layerHeight = this.sourceRectAtTime().height;
    layerWidth = this.sourceRectAtTime().width;

    [layerLeft + layerWidth/2, layerTop + layerHeight/2];

    Now that AfterEffects has updated, new projects give me an error:


    After Effects warning: Expression Disabled
    Error at line 1 in property 'Anchor Point' of layer 1 ('test') in comp 'Comp 1'

    TypeError: this.sourceRectAtTime is not a function

    > layerTop = this.SourceRectAtTime().top;
    layerLeft = this.sourceRectAtTime().left;

    What’s going on here?

    Tristan Summers replied 7 years, 2 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    October 17, 2018 at 8:02 pm

    I think the new JavaScript engine doesn’t like the this keyword. Try it this way:

    layerTop = sourceRectAtTime().top;
    layerLeft = sourceRectAtTime().left;
    layerHeight = sourceRectAtTime().height;
    layerWidth = sourceRectAtTime().width;

    [layerLeft + layerWidth/2, layerTop + layerHeight/2];

    Dan

  • Adam Haas

    October 17, 2018 at 8:08 pm

    That was it. How silly. Thank you so much.

  • Tristan Summers

    March 7, 2019 at 11:16 am

    Saved my life once again DE.
    Many thanks.
    Call in any mafia style favour anytime!

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