ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

TypeError: this.sourceRectAtTime is not a function

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Adam Haas
TypeError: this.sourceRectAtTime is not a function
on Oct 17, 2018 at 6:34:53 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?


Return to posts index

Dan Ebberts
Re: TypeError: this.sourceRectAtTime is not a function
on Oct 17, 2018 at 8:02:55 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



Return to posts index

Adam Haas
Re: TypeError: this.sourceRectAtTime is not a function
on Oct 17, 2018 at 8:08:11 pm

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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]