Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Adding a clamp to sourceRectAtTime?

  • Adding a clamp to sourceRectAtTime?

    Posted by Quest Rogers on May 25, 2023 at 5:09 pm

    Hello,

    I have a lower third template in which I want to clamp the Y value of the “Size” property of a Rectangle Path on a shape layer. I want this shape layer to ignore scaling in “Size” Y beyond a certain value as it and the text animates on/off. The text gets quite all then scales down as it animates but I don’t want the box behind it to scale beyond a certain value. I’m having trouble figuring out how to incorporate a clamp or something similar into the expression I’m using below. If anyone has any tips on how to add a clamp to this I’d appreciate it!

    h = thisComp.layer(“NAME”).sourceRectAtTime(time,false).height;

    w = thisComp.layer(“NAME”).sourceRectAtTime(time,false).width;

    [w,h]

    Quest Rogers replied 1 year, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 25, 2023 at 6:47 pm

    Something like this maybe:

    minH = 10;
    h = thisComp.layer("NAME").sourceRectAtTime(time,false).height;
    w = thisComp.layer("NAME").sourceRectAtTime(time,false).width;
    [w,Math.max(h,minH)]
  • Quest Rogers

    May 25, 2023 at 9:33 pm

    Thanks Dan! I’ll give this a try.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy