Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE AFTER EFFECTS:HomeForumBasicsExpressionsTutorialsPodcastsAE TechniquesTrainingCreative Cloud DebateFAQ

Re: Question-making positon and scaling expression

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Share on Facebook
Respond to this post   •   Return to posts index   •   Read entire thread


Dan EbbertsRe: Question-making positon and scaling expression
by on Apr 23, 2012 at 6:55:09 am

If you put your image in a precomp that is exactly the size of the image, you have several options for a scale expression. This expression will cause the image (and any replacement) to exactly fill the precomp (but will distort the image if the replacement has a different aspect ratio):

w = thisComp.width/width;
h = thisComp.height/height;
[value[0]*w,value[1]*h]

This one eliminates the distortion, and makes the best fit without cropping the image, but it may leave gaps at the top and bottom, or on the sides:

w = thisComp.width/width;
h = thisComp.height/height;
if (w < h) value*w else value*h

This one eliminates the distortion and fills the precomp, but may crop the top and bottom or the sides:

w = thisComp.width/width;
h = thisComp.height/height;
if (w > h) value*w else value*h


All of these assume that all the images are square pixels. If not, the expressions get somewhat more complicated.

Dan



Posts IndexRead Thread
Reply   Like  
Share on Facebook


Current Message Thread:




LOGIN TO REPLY



FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2013 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]