Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save david-littlefield/a6688bd1b2a0e024544aed789b2c3f48 to your computer and use it in GitHub Desktop.
Save david-littlefield/a6688bd1b2a0e024544aed789b2c3f48 to your computer and use it in GitHub Desktop.
[Scale Object to Match Height of Card] Increases or decreases size of object to match the height of card. #after_effects #scale #vertical #card #object
// Scale
var card_layer = comp("Left").layer("Card");
var card_rectangle = card_layer.sourceRectAtTime();
var card_height = card_rectangle.height;
var object_layer = thisComp.layer("Object");
var object_rectangle = object_layer.sourceRectAtTime();
var object_height = object_rectangle.height;
var height_ratio = (card_height / object_height) * 100;
[height_ratio, height_ratio];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment