ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Problem when using SourceRectAtTime expression

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


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!



Posts IndexRead Thread 


Current Message Thread:





© 2019 CreativeCOW.net All Rights Reserved
[TOP]