ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

sourceRectAtTime collapse transformations

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Thomas Collier
sourceRectAtTime collapse transformations
on Jun 5, 2020 at 5:51:09 pm

Does sourceRectAtTime not work with collapse transformations, or am I doing something wrong?

I am trying to align my anchor point to the bottom left side of the precomp. Inside are items of various heights that turn on and off. I thought it would be as simple as turning on collapse transforms so sourceRect could find the height. My bounding box seems correct when I collapse transformations, but the anchor point sticks to the bounding box of the comp without collapse transformations on.

x=thisLayer.sourceRectAtTime().left;
y=thisLayer.sourceRectAtTime().top+height;
[x,y];


Return to posts index

Andrei Popa
Re: sourceRectAtTime collapse transformations
on Jun 6, 2020 at 8:05:24 am

Here is an expression for bottom left anchor point

var left = sourceRectAtTime(time,false).left;
var myHeight = sourceRectAtTime(time,false).height;
var top = sourceRectAtTime(time,false).top;
[left,myHeight+top]


Andrei
My Envato portfolio.


Return to posts index

Thomas Collier
Re: sourceRectAtTime collapse transformations
on Jun 6, 2020 at 1:51:29 pm

Yes, I am having the same issue with your version of the expression. The anchor point is snapping to the bounding box of the layer without collapse transformations on. My question is, can I attach the anchor point to the bounding box of the layer with collapse transformations on.


Return to posts index


Andrei Popa
Re: sourceRectAtTime collapse transformations
on Jun 8, 2020 at 7:55:16 am

I don't understand this behavior.
Can you attach one or two photos?

Andrei
My Envato portfolio.


Return to posts index

Thomas Collier
Re: sourceRectAtTime collapse transformations
on Jun 8, 2020 at 1:38:44 pm

Here is my precomp with 3 "logos" in it:



Here is my main comp without collapse transformations on for the precomp, as you can see the bounding box is the size of the precomp:



Here is my main comp with collapse transformations on for the precomp, the bounding box has changed to the height of my tallest layer:



Here is the precomp with your sourceRectAtTime expression applied to the anchor point. Notice the anchor point is looking at the precomp size, even though collapse transformations is active.



Return to posts index

Robert Müller
Re: sourceRectAtTime collapse transformations
on Jun 9, 2020 at 8:44:57 am

Yes, you are right. sourceRectAtTime does not work with collapse transformations checked on precomps there are workarounds using the sampleImage function and looking for alpha values. But this is not very user friendly because it takes lots of time to calculate. So your best bet would be to crop your precomp to the actualy size, there are excellent scripts for this out there.


Return to posts index

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