FORUMS: list search recent posts

Set scale in pixels using expressions

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jeremy Paul
Set scale in pixels using expressions
on Aug 21, 2017 at 12:49:14 pm

You can right click on a scale, hit Edit, and then enter scale in Pixels, inches , % of Comp, of source.... How can set the units using expressions?

They default to percentages of source (I think) which is somewhat limited.


Return to posts index

Dave LaRonde
Re: Set scale in pixels using expressions
on Aug 21, 2017 at 6:16:47 pm

How so? 18.283% would sound pretty specific to me.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

Jeremy Paul
Re: Set scale in pixels using expressions
on Aug 21, 2017 at 9:11:18 pm

Now position another layer to always be 20% taller than the text layer while text layer always being at the 66 percent of comp height regardless of the font family and size and number of letters, lines... Should I go on? 😃I think pixels make things easier


Return to posts index


Steve Bentley
Re: Set scale in pixels using expressions
on Aug 22, 2017 at 2:14:58 am

I think the problem is that scale is logarithmic or at the very least exponential. But I can see a use for pixels was well, but then it should be called width and height. Aren't width and height parameters you can access in the expressions? (I'm not in front of the machine at the moment so I could be thinking of C4d's scripting language).



Return to posts index

Jeremy Paul
Re: Set scale in pixels using expressions
on Aug 22, 2017 at 9:59:23 am

You can access them with sourceRectAtTime method. The problem is that accessing is all I managed to do. There is no setSourceRectAtTime for example. I tried setting scale as ["200px", "100px"], but that returned an error


Return to posts index

Walter Soyka
Re: Set scale in pixels using expressions
on Aug 25, 2017 at 7:30:15 pm

[Jeremy Paul] "They default to percentages of source (I think) which is somewhat limited."

That's correct. You'll have to do the math to convert from your desired pixel size to scale percentage of original. Here's an expression you can apply to a 2D scale property that lets you input in the scale in pixels directly into the scale property on the timeline without opening the dialog box:

[value[0]/sourceRectAtTime().width*100, value[1]/sourceRectAtTime().height*100]

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

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