Scripting and expressions are great tools that allow you to bring a great deal of automation to After Effects projects. When properly configured, it is possible to quickly and accurately populate AE projects with all manner of content automatically so that all assets will fit within the confines and strictures of your designs. Using scripts and expressions, it is possible to:
- Automatically resize images to fit pre-defined spaces (aka "auto scale").
- Fit or Fill images based on horizontal and/or vertical pixel count.
- Dynamically justify images to the left/right/upper/lower (or combinations thereof) of any defined composition or space.
- Dynamically justify text to the left/right/upper/lower (or combinations thereof) of any defined composition or space.
- Scale text automatically to fit inside a pre-defined space.
- Break up a text strings into independent comps based on number of characters, spaces, sentences, paragraphs etc. Each word (or character, or paragraph) can be treated and animated differently.
- Dynamically define duration of an entire animation based on any parameter; for instance, an animation can be timed to the duration it takes to read a line of text (as defined by number of characters). More text = longer duration. Also, comp duration can be based on the duration of a video clip.
- Turn design elements on or off based on any parameter: for instance, if there is an image in a composition, then a "carrier" design element will be automatically turned on and scaled to compliment the image.
- Automatically populate text layers based on a consistent data stream (for instance, an XML file).
- Automatically import images based on a consistent data stream (for instance, an XML file).
- Sample a region of an image to automatically generate a complimentary colour fill.
- Dynamically create and place design elements based on arbitrary measurements. For instance, if a picture is submitted, calculations could automatically create "photo corners" that would then be placed accurately at each corner of the image.
- Assets can define the layout of the animation. For instance, if there are one, two or three images submitted to a project, the design will be different for each eventuality. One image = a large, primary image in the design comp. Two images = a composition that has two images in the comp equally sized, etc.
- Consistent data streams (XML, spreadsheets, tab-delimited files) can be used to automatically populate entire compositions.