FORUMS: list search recent posts

Problem when using SourceRectAtTime expression

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ken Kwong
Problem when using SourceRectAtTime expression
on Jun 20, 2019 at 9:57:11 pm
Last Edited By Ken Kwong on Jun 20, 2019 at 10:34:00 pm

Hi, I am using the SourceRectAtTime() Expression sample from ECAbrams to have a rectangle shape layer resizes itself according to a text layer's height and width. It's working nicely.

s=thisComp.layer("HELLO");
x=s.sourceRectAtTime(time-s.inPoint,true).width;
y=s.sourceRectAtTime(time-s.inPoint,true).height;
[x,y]


Then I realized the "timing" is based on the layer time but not the comp time (which is solved by using time-inPoint)

But after that, I also realized SourceRectAtTime starts counting from the "initial starting point" of the text layer, which means when I extend or reduce the text layer's starting point, the inPoint is looking at the altered starting point, but the SourceRectAtTime is looking at the initial starting point of the text layer. That makes the timing "off"

So I am thinking if there's anything that can replace time-inPoint, so we can get the "initial starting point" which matches the SourceRectAtTime. But no luck yet...

Any help on this will be greatly appreciated!



Return to posts index

Oleg Pirogov
Re: Problem when using SourceRectAtTime expression
on Jun 21, 2019 at 6:19:40 am

>if there's anything that can replace time-inPoint, so we can get the "initial starting point"
Threre's startTime.
Just put it in place of inPoint, that should get you what you're looking for.


Return to posts index

Ken Kwong
Re: Problem when using SourceRectAtTime expression
on Jun 28, 2019 at 2:18:07 am

Simple, direct, and it works perfectly!
Thanks a lot and this makes me think all the tutorials teach people to use inPoint for SourceRectatTime should correct it...


Return to posts index

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