I often set the scale in pixels, using right click on a scale, hitting Edit, and then enter scale in Pixels. How can set the scale using expressions? And generally, how do you set the units using expressions?
Adobe Community Professional, Aug 26, 2017Aug 26, 2017
Tomas Sinkunas • Adobe Community Professional, Aug 26, 2017Aug 26, 2017
Another approach would be to use expression. Apply this expression to scale property and adjust targetSize parameter. It will set Scale to maintain your desired pixel size.var targetSize = [500, 500];var sr = thisLayer.sourceRectAtTime(time);[targetSize / sr.width * 100, targetSize / sr.height * 100];
AE has no "units". All values are intrinsic to the property stream and use its value ranges. Scale will always be in percent. You have to employ your own math to calculate the percentages. Simple 6th grade school stuff. Most commonly people use the linear() interpolator to that effect:
Another tip that will help is that you can set up Expression control sliders to adjust the target size, width and height values, this will give you slider controls that are much easier to access than opening and editing fiddly expressions.
Just create the sliders, rename them Scale X (Pixels) and Scale Y (Pixels).