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/6c1b52556a13c775322aafdef56192e1 to your computer and use it in GitHub Desktop.
Save david-littlefield/6c1b52556a13c775322aafdef56192e1 to your computer and use it in GitHub Desktop.
[Attach Title Background to Top of Background Card] Sets position of title background to top of background card. #after_effects #title #background #title_background #top #position
// Transform Position
var background_composition = comp("Top Left");
var background_layer = background_composition.layer("Background");
var background_position = background_layer.position;
var background_x_value = background_position[0];
var background_y_value = background_position[1];
var background_rectangle = background_layer.sourceRectAtTime();
var background_width = background_rectangle.width;
var background_height = background_rectangle.height;
var background_top = background_y_value - (background_height / 2);
var title_background_composition = comp("Top Left");
var title_background_layer = title_background_composition.layer("Title Background");
var title_background_rectangle = title_background_layer.sourceRectAtTime();
var title_background_width = title_background_rectangle.width;
var title_background_height = title_background_rectangle.height;
var x_value = background_x_value;
var y_value = background_top + (title_background_height /2);
[x_value, y_value];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment