ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

sourceRectAtTime doesn't properly update !?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Patrick Grossien
sourceRectAtTime doesn't properly update !?
on Jan 20, 2016 at 6:23:56 pm

So this is weird. I'm using CC2015 and sourceRectAtTime doesn't update properly for me.

Basically I want to fake a typing situation with the blinking cursor behind the appearing text. So I created a text layer with appearing text and wanted to stick the blinking cursor layer to the end of the text and have it move along with the appearing text.

My text is set up so that it appears over time via an animated slider:

n=thisComp.layer("john.doe@me.com").effect("Tipp Counter")("Slider");
showtext=text.sourceText.substr(0,n);


Now I tried to attach the blinking cursor to the end of the appearing text.

L = thisComp.layer("john.doe@me.com");
r = L.sourceRectAtTime(time,false);
fromComp(L.toComp([r.left+r.width,r.top+r.height]))


The value is not being updated over time and the cursor doesn't move at all.
I also checked what happens with the width of sourceRectAtTime and it doesn't update either when used solo.

Any insight as to what I'm doing wrong? Or is there a bug I'm missing.

Thanks!


Return to posts index

Todd Kopriva
Re: sourceRectAtTime doesn't properly update !?
on Jan 20, 2016 at 6:38:58 pm

http://blogs.adobe.com/aftereffects/2014/12/after-effects-cc-2014-2-13-2.ht...



"The values returned are calculated before effects and layer styles are applied."

---------------------------------------------------------------------------------------------------------
Todd Kopriva, Adobe Systems Incorporated
After Effects product manager and curmudgeon
After Effects team blog
---------------------------------------------------------------------------------------------------------


Return to posts index


Dan Ebberts
Re: sourceRectAtTime doesn't properly update !?
on Jan 20, 2016 at 6:44:09 pm

I'm not seeing that behavior (on CC 2015). I tried it with a slider controlling the number of characters on the text layer and sourceRectAtTime() on another layer, and the width does update for me.



Return to posts index


Patrick Grossien
Re: sourceRectAtTime doesn't properly update !?
on Jan 20, 2016 at 7:28:41 pm

Thank you all for your responses.

Now I'm angry at myself, because I haven't tried it in an empty composition. Weird enough it works fine there, too. Now I gotta figure out what's wrong in the main comp. Still weird..

But I'm now having another problem with that expression:

L = thisComp.layer("john.doe@me.com");
r = L.sourceRectAtTime(time,false);
fromComp(L.toComp([r.left+r.width,r.top+r.height]))


I think I'm having problems with the "fromComp" "toComp" situation. I though this would make it stick to the lower right corner of the text layer but the cursor sticks at the upper left corner of the composition. How would I set this up to make it position with the text layer?


Return to posts index


Dan Ebberts
Re: sourceRectAtTime doesn't properly update !?
on Jan 20, 2016 at 8:37:03 pm

I think this will give you the lower right corner of the text (assuming everything is at 100% scale):

L = thisComp.layer("john.doe@me.com");
r = L.sourceRectAtTime(time,false);
L.toComp(L.anchorPoint)+[r.left+r.width,r.top+r.height]


Dan



Return to posts index

Patrick Grossien
Re: sourceRectAtTime doesn't properly update !?
on Jan 20, 2016 at 9:14:28 pm

You're a life safer! Thanks Dan! That's it.

I need to wrap my head around this whole fromComp toComp thing somehow....


Return to posts index


Patrick Grossien
Re: sourceRectAtTime doesn't properly update !?
on Jan 20, 2016 at 9:30:46 pm

I found out what was happening. It happens when I slide the layers over so that they start later but the animation for the blinking cursor happens at the beginning of the composition (with no active layers) and not from the point in time, when the actual layer starts. So the whole animation doesn't offset along with the layers in points.

I thought "time" would work at the current playhead time. Any insight to this?

Thanks!


Return to posts index


Patrick Grossien
Re: sourceRectAtTime doesn't properly update !?
on Jan 20, 2016 at 9:45:49 pm

OK, I believe I got it:

L = thisComp.layer("john.doe@me.com");
inP = inPoint;
r = L.sourceRectAtTime(time-inP,false);
L.toComp(L.anchorPoint)+[r.left+r.width,r.top+r.height]

I took the inPoint of the Cursor Layer and subtracted it from "time".
I just don't get why I need to do that and why it needs to be subtracted and not added...

(both layers have their inPoints at the same point in time. the actual animation of the appearing text starts a few frames after the inPoint)


Return to posts index

David Cabestany
Re: sourceRectAtTime doesn't properly update !?
on Jul 30, 2019 at 8:52:25 pm

Sorry to hijack your thread, but this is somewhat related.

sourceRectAtTime works as expected when typing up the text and also if I vary the length of each line on a multi-line text layer, but if I animate the writing of the text using a text animator (typewriter, for example) it only shows the end size, the affected object does not vary its size as the text layer is growing in size.

Your help is greatly (and urgently) appreciated.


Return to posts index

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