SIGN IN
::
SPONSORS
::
ADVERTISING
::
ABOUT US
::
CONTACT US
FORUMS
TUTORIALS
MAGAZINE
STOCKYARD
VIDEOS
PODCASTS
EVENTS
SERVICES
NEWSLETTER
NEWS
BLOGS
ADOBE AFTER EFFECTS:
Home
Forum
Basics
Expressions
Tutorials
Podcasts
AE Techniques
Training
Creative Cloud Debate
FAQ
Re: Question-making positon and scaling expression
COW Forums
:
Adobe After Effects Expressions
FAQ
•
VIEW ALL
•
ADD A NEW POST
•
PRINT
Respond to this post
•
Return to posts index
•
Read entire thread
Re: Question-making positon and scaling expression
by
Dan Ebberts
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 Index
Read Thread
Reply
Like
Current Message Thread:
Question-making positon and scaling expression
by Ross Turiano on Apr 23, 2012 at 3:49:17 am
Re: Question-making positon and scaling expression
by Dan Ebberts on Apr 23, 2012 at 6:55:09 am
Re: Question-making positon and scaling expression
by Ross Turiano on Apr 23, 2012 at 10:26:51 pm
LOGIN TO REPLY
FORUMS
•
TUTORIALS
•
MAGAZINE
•
STOCKYARD
•
VIDEOS
•
PODCASTS
•
EVENTS
•
SERVICES
•
NEWSLETTER
•
NEWS
•
BLOGS
© 2013
CreativeCOW.net
All rights are reserved. -
Privacy Policy
[
Top
]