ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Is there any way to use sourceRectAtTime() with Trim Paths?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Andrei Popa
Is there any way to use sourceRectAtTime() with Trim Paths?
on May 3, 2018 at 3:11:16 pm

I am creating some handwriting effect and i am trying to add justification by adding an expression to the anchor. But when i animate the "End" of the trim paths to the shapes, anchor begins to float as the writing effect unfolds. I would like it to be in the place it is when the trim paths is at 100%. I thought of adding as time for the sourceRectAtTime() function the time of the last keyframe, but it is not always 100% in the last keyframe. Any ideas on how to do that? This is the expression i currently have
myLeft = thisLayer.sourceRectAtTime(time,true).left;
myTop= thisLayer.sourceRectAtTime(time,true).top;
myHeight = thisLayer.sourceRectAtTime(time,true).height;
myWidth = thisLayer.sourceRectAtTime(time,true).width;
temp = effect('AE Handwriter')('Justification');
if (temp == 1){
[myLeft + myWidth/2,0]
}else if(temp == 2){
[myLeft + myWidth,0]

Works perfectly on 100% Trim paths, but very bad in animation.

My Envato portfolio.

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 All Rights Reserved