Best practices for Dynamic Graphics Render
Explore best practices and find answers to frequently asked questions about Firefly Services Dynamic Graphics Render API for Adobe After Effects Projects and Motion Graphics Templates.
Who is this guide for?
This document is intended to help guide motion designers working in Adobe After Effects to create optimized Motion Graphic Templates (MOGRT) or Adobe After Effects Projects (AEP) that are compatible with the Dynamic Graphics Render (DGR) API.
What is Dynamic Graphics Render?
Dynamic Graphics Render (DGR) is an infinitely scalable service that renders data-driven Adobe After Effects templates using Motion Graphics Templates (MOGRT) and Adobe After Effects Projects (AEP). The service reduces repetitive tasks required to produce and render video variations through automation and integrations in production and marketing supply chains.
Driven by a structured data set that represents the changeable parameters defined in Adobe After Effects (like CSV or JSON), the service concurrently renders each video and returns the output to your designated cloud location (for example, Frame.io or a signed URL location).
What can DGR be used for?
DGR can be used to render any MOGRT or AEP at scale. Typical use cases include:
Rendering videos that are optimized for various:
- target audiences,
- consumption devices, and
- social platforms.
Rendering a high volume of:
- video with different text,
- images, and
- video and audio for advertising and performance marketing.
When to use DGR with an AEP workflow
In most cases, using DGR with an AEP workflow is the preferred method.
- Additional capabilities such as layer operations, advanced audio replacement, and the Advanced 3D and Cinema 4D renderers are available.
- If your templates need to dynamically adapt to the duration of replacement assets, the AEP workflow is required.
- You would like to render multiple comps from the same template (in separate API calls). For example, this allows you to have different versions of a template (for example, 9:16 and 16:9) in a single source file, and you can choose which comp to render.
- You require a modified
.aepproject from DGR, in order to carry out "last mile" adjustments. This project file contains all data and layer operation changes. - If changes to the template are required after collecting, you can open the collected
.aepfile and make changes directly. This can make it easier to work on templates as part of a team. - If you require the burned-in captions features of DGR, this is currently only available through an AEP workflow.
When to use DGR with a MOGRT workflow
- If your project contains a single main composition that should be rendered, or you would like to explicitly separate compositions into different template files (for example, for 9:16 and 16:9).
- If your composition and its layers will not need to change their duration or timing.
- If your template already exists as a MOGRT – in this case, you may not need to make any (or many) changes in order to use it with DGR.
- If you would like to ensure that certain advanced capabilities, such as layer operations, are not made available to the end user.
- If you would like to discourage editing of templates after their creation.
- If you would like to package a specific Adobe After Effects composition and its associated assets into a single, easily distributable file.
data-variant=info
data-slots=heading, text
.zip and expanding to a .aeproject file. You can then rename the file extension of this to .zip and expand a second time to get a .aep file with its associated footage.Core capabilities of DGR
DGR capabilities include (but are not limited to) text replacement, image and video replacement, and audio replacement (which is a feature not available in standard MOGRT workflows).
When using DGR with an Adobe After Effects Project, capabilities additionally include (but are not limited to) dynamic layer operations (retiming comps and layers, and enabling/disabling layers) and SRT-driven, burned-in captions. Image, video and audio replacement takes place within the comp, allowing functionality (such as re-positioning layers based on a replacement media source's width) not possible in standard MOGRT workflows.
Motion designers can design templates in Adobe After Effects and export them as .mogrt files, or collect projects and compress to a .zip file, which contains the project's .aep file and all associated assets. The DGR API is able to recognize exposed Essential Properties controls for data insertion. By providing a dataset to populate these controls, users can generate hundreds or thousands of video variations without manually updating the template in Adobe After Effects or Adobe Premiere.
End users don't need to have Adobe After Effects or Adobe Premiere experience. If a user can fill out a spreadsheet or complete an online form, they're able to generate videos with Dynamic Graphics Render.
Tips for preparing a DGR-ready Adobe After Effects project (MOGRT and AEP types)
These tips will help you prepare your templates to be DGR-ready.
Create separate templates or comps for different aspect ratios:
When creating videos for multiple aspect ratios (for example, 9:16 portrait; 16:9 landscape), a separate MOGRT or comp should be created for each.
Give properties unique names in the Essential Graphics panel:
To avoid any potential conflicts in the API, it's recommended to ensure that all properties (controls) in the Essential Graphics panel have unique names, even if you're separating similar controls into groups.
For example, if you have a "Text" property in both an "Intro" and an "Outro" group, consider naming the properties "Intro Text" and "Outro Text".
Pre-render where possible:
It can often be beneficial to pre-render the parts of your composition that won't change, or that won't interact with any customizable elements. This reduces the processing requirements when rendering, for a faster output.
This can also be helpful when your template contains effect-heavy layers that render slowly. You can check for these layers by enabling the Render Time column. To enable this, right-click in the header row of the Timeline panel and select Columns > Render Time, or click the snail icon in the bottom-left of the Timeline panel.
Avoid third-party effects and plug-ins:
It's not currently possible to install third-party effects or plug-ins. Please avoid using these in your templates. If third-party effects or plug-ins are used, your DGR exports may fail, or may not render as expected.
If third-party effects are unavoidable, consider if you are able to pre-render those layers before exporting the template.
Include safeguards for safe areas:
If designing for formats that recommend keeping elements within safe areas (for example, to avoid cut-off in TV broadcasts, or to avoid elements being placed underneath the UI in apps like Instagram or TikTok), be aware that dynamic content might extend beyond the planned area. This is most likely with Text layers set to Point text.
It can be helpful to add expressions to limit or adjust the size or position of your layers to automatically keep them within the safe areas, for example, by using copyfit expressions to scale down a text layer if its content exceeds a specified width.
Recommended safe area guidelines can generally be found on the platform's website or provided by your team's contact at the relevant organization.
Tips for preparing a DGR-ready Adobe After Effects project (MOGRT type)
Design templates for a fixed duration:
In Adobe Premiere, MOGRTs can be created with protected regions, allowing a user to adjust the duration of the template.
These adjustable duration compositions are not currently supported by DGR when using a MOGRT as the input. Videos rendered with DGR are always the same duration as the composition from which the MOGRT was created.
If templates of different durations are required, these should be created as separate MOGRTs.
(Variable duration videos and layers are supported by DGR when using an AEP as the input.)
Real-time feedback is not available via DGR when using a MOGRT as the input – plan your MOGRT controls accordingly:
When using MOGRTs in Adobe Premiere, users can see the template update in real time when control values are changed. As the DGR API runs as a headless service, this real-time feedback is not available. Plan your controls with this limitation in mind.
For example, rather than using a Slider control to adjust the position of a layer, consider using a Dropdown Menu control to limit the position to a few pre-defined options.
Be sure to test the template for edge cases within Adobe After Effects before exporting the MOGRT.
(Real-time feedback is supported by the DGR Panel extension, when using DGR with an AEP as the input.)
Use the Classic 3D renderer:
If your template includes 3D layers, ensure all relevant compositions are using the Classic 3D renderer. The Advanced 3D and Cinema 4D renderers are not supported by DGR when using a MOGRT as the input.
In Adobe After Effects, you can change the renderer in the 3D Renderer tab in the Composition Settings dialog box.
(All 3D renderers are supported by DGR when using an AEP as the input.)
Tips for preparing a DGR-ready Adobe After Effects project (AEP type)
Audio replacement requires audio-only layers:
Only audio-only layers are described for audio replacement. You can tell if a layer is audio-only when the eyeball icon is missing but the audio icon is present.
To replace audio in layers that also contain graphics, expose these layers as replacement media controls in the Essential Graphics panel.
Real-time feedback with DGR Panel:
You can install the DGR Panel extension from Adobe Exchange to add a panel to Adobe After Effects which allows you to test dynamic changes to your templates in real-time.
Instead of guessing how a render batch will turn out, you can see exactly how replacement data resolves in your template, how layer operations reshape your composition, generate the matching render payload, and run test renders against the DGR API – all without leaving Adobe After Effects.
This allows the designer to confidently test for edge cases with real and sample data, build an array of layer operations, and send test renders to the DGR API.
Optimizing template file size
Larger file sizes (for both .mogrt and collected .zip files) can increase render times. These tips can help you optimize for performance.
Exclude video preview (MOGRT workflow only):
When exporting a MOGRT from the Essential Graphics panel, the Include video preview option gives you the choice to embed a video preview in the .mogrt file. This is used in Adobe Premiere and other software to preview the template; for instance, in Adobe Premiere's Graphics Templates panel.
This preview is not used by DGR, so disabling this option before exporting can significantly reduce the file size.
Optimize non-replaceable media assets:
If your template uses media assets such as video, image or audio files that are not replaceable, you may be able to optimize these. Consider the following examples:
- Scale or crop: If a video or image is only ever displayed at 50% scale, you could scale the original file to 50% and set the scale in Adobe After Effects to 100%. If only the top half of a video or image is ever displayed, you might wish to crop the original file to that region.
- Duration: If a video or audio layer only uses a section of the asset's full duration, you could trim the original file to just that section, and reimport to Adobe After Effects. Replace and align the original layer(s) to match.
- File format: Uncompressed formats, such as
.mov,.tiffor.wav, usually have larger file sizes. You can experiment with re-encoding these to compressed formats, such as.mp4,.jpgor.mp3. It's important to note that Adobe After Effects will generally process uncompressed formats faster, but smaller file sizes may lead to overall faster job completion in DGR. - Alpha: If a video requires an alpha channel (usually requiring a larger
.movfile), an alternative may be to render a non-alpha version alongside a luma matte, and use the luma matte to reintroduce the alpha channel.
Optimize media replacement assets:
You might find that your template includes large assets that will always be replaced as part of the DGR job. In this case, you can swap these out for placeholder assets with smaller file sizes.
For both video and image layers, you can use an image placeholder (note: a media replacement control can receive either an image or a video, in both MOGRT and AEP templates). To do this, open the Essential Graphics panel and right-click the video or image control to select the Replace Layer with Placeholder option. This will create a new image file in your Project panel and replace the layer's source with this.
Alternatively, you can create your own placeholder image at an appropriate size and replace the original asset with this. Import the placeholder, select your assets in the Project or Timeline panel, and – while holding Alt (Windows) or Option (macOS) – drag the placeholder asset from the Project panel onto these.
For audio layers, you can replace the asset with a short, silent audio clip. You can download a suitable placeholder clip: silent.wav. To do this, either right-click each asset in your Project panel and select Replace Footage with this placeholder audio file, or import the audio file and drag-replace using the technique described above.
Reduce project:
Select your top-level comps in the Project panel and go to File > Dependencies > Reduce Project. This will remove any comps or assets that are not within the selected comps (or their children).
Video replacement
When assigning a layer as a Media Replacement property in the Essential Properties panel, be sure to set the Scale option to match the desired Scale to fill, Scale to fit, Stretch to fill, or No scale outcome. While you can override this scaling behavior via DGR, this ensures that the default state in the template is correct.
There is no limit on individual file size. However, the combined size of assets that can be replaced is capped at 5 GB.
- Resolution: Up to 3840 x 2160 pixels
- Frame rate: Up to 60 FPS
data-variant=info
data-slots=heading, text1, text2
Image replacement
When assigning a layer as a Media Replacement property in the Essential Properties panel, be sure to set the Scale option to match the desired Scale to fill, Scale to fit, Stretch to fill, or No scale outcome. While you can override this scaling behavior via DGR, this ensures that the default state in the template is correct.
We support the file types described in the API reference and job responses when validation fails, with no limit on individual file size. However, the combined size of assets that can be replaced is capped at 5 GB.
- Resolution: Up to 3840 x 2160 pixels
Audio replacement
We support the file types described in the API reference and job responses when validation fails, with no limit on individual file size. However, the combined size of assets that can be replaced is capped at 5 GB.
Audio replacement in MOGRT workflow (Global Audio Replacement)
There is no need to set this up in Adobe After Effects, as the Essential Graphics panel currently doesn't support audio replacement.
Currently, only one audio track is replaceable, with the following options:
- Replace: All existing audio is removed from the template, and the new audio file is inserted.
- Mix: Existing audio is retained, and the new audio is added to it.
Replacement audio tracks will always play from the start of the composition until the end of the composition, or until the end of the audio track (if the audio track has a shorter duration than the comp).
Audio processing features, like volume adjustment or ducking, are not available. If audio needs processing, like retiming to fit with the video timing, this should be done in an application like Adobe Audition before uploading to your media server, or the AEP workflow should be used.
Audio replacement in AEP workflow
All audio-only layers in your main comp are exposed as audio replacement layers. You do not need to add these layers to the Essential Graphics panel.
The source of these layers can be replaced or mixed:
- Replace: The layer's existing audio is replaced with the new audio file.
- Mix: Existing audio is retained, and the new audio is added as an additional layer, with the same in and out points.
Replacement audio files will inherit the trimming of the original layer. For example, if the first second of the audio is trimmed, this first second will still be trimmed after audio replacement. You can use layer operations to adjust the timing of the audio layer, if needed.
If you add a new audio track to the template using the Mix option above, but would like to also perform layer operations on this new track within the same call, it's recommended to instead add an additional audio track to your template and use the Replace option on this layer's described control. That way, the layer will be described and targetable by layer operations. Alternatively, you could use the Mix option, download the modified AEP via the sidecar option, and run a subsequent job with this new template.
Data files inside MOGRT or AEP
Data files (like CSV, TSV, or JSON files) can be included in Adobe After Effects projects to drive animations or populate property values. DGR supports MOGRTs that include and reference data files. It's recommended that any data files referenced in your project are added as a layer within a composition.
However, DGR does not currently support Media Replacement of data files.
Font replacement
When calling the DGR API, fonts can be replaced by referring to a font's PostScript name. Any fonts used in the MOGRT should be delivered with the .mogrt file, as they will need to be supplied to the API service. Users are expected to have valid licenses for all fonts used.
Font replacement is also possible via expressions. References to fonts in expressions must match the font's PostScript name.
data-variant=info
data-slots=heading, text
Text sizing
The native font size properties available to MOGRTs are not available to the Dynamic Graphics Render API.
Two alternatives exist:
- Font sizes can be defined in expressions (and controlled by an exposed Slider or Dropdown control).
- The Scale property of text layers can be adjusted by linking a Slider control to the layer's Scale property.
Copyfit (Text fitting)
Copyfitting is not an inherent feature of DGR, MOGRTs, or Adobe After Effects.
Expressions can be added to layers to scale text to fit within specific boundaries, or to reposition based on the position or size of other layers in the comp.
You can find examples of copyfitting expressions and animation presets in the Expressions guide.
How to pass blank text values
For each variation, a text control's value works as follows:
- Omit the variable to keep the template's default text.
- Pass
""to clear the text. - Don't pass
null: anullor missingtextvalue is rejected.
{ "variableId": "<text control variableId>", "text": "" }
When data comes from a CSV file or spreadsheet, a blank cell usually means "no value", so the control falls back to its default. To get blank text from a table, map those cells to "" when building the request. Alternatively, set the control's default to a blank string in the Essential Graphics panel before exporting the .mogrt or collecting the .aep file.
Layer operations
When using DGR with an AEP workflow, you are able to apply various layer operations to layers, to adapt their timing and/or enabled status. This allows you to create dynamic templates not possible with traditional MOGRT workflows. Examples include:
- Extend/shorten comp duration based on replacement video duration: If you replace a video with one that is longer than the original, you can apply layer operations to extend the duration of this layer and its comp, and shift any subsequent layers accordingly.
- Maintain rendered video duration and fill gaps: If you replace a video with one that is shorter than the original, you can apply layer operations to shift and/or stretch existing layers to fill the gap.
- Generate stems: Maintain a single comp and use the
enable_layerlayer operation to turn on/off various layers to generate stems.
For a full list of layer operations and their descriptions, see Layer operations (AEP only) in the Render API guide.
It can be difficult to visualize how layer operations will affect a composition. We recommend using the DGR Panel extension from Adobe Exchange, which allows you to build a list of layer operations and test dynamic changes to your templates in real-time. This panel also allows you to view the render payload, which contains the generated layer operations payload.
How to export a MOGRT for DGR (MOGRT workflow)
- Open the Essential Graphics panel (this is where you will have been adding controls for the MOGRT).
- You can find this under Window > Essential Graphics.
- Click the Export Motion Graphics Template… button in the bottom-right corner.
- Save your project when prompted to do so.
- Destination: Choose a folder to save your
.mogrtfile to. - Include video preview: You can choose whether or not to embed a video preview in the
.mogrtfile. DGR currently doesn't make use of this, so it's recommended to disable this option to reduce the size of the MOGRT. - Click OK.
DGR is currently compatible with MOGRTs created in Adobe After Effects 2026 or earlier. If you have created your Adobe After Effects project in a later version:
- Save to a version compatible with Adobe After Effects 2026 via File > Save As… > Save a Copy As 26.x….
- Then open that file in Adobe After Effects 2026 and export the MOGRT from the Essential Graphics panel.
How to export a project for DGR (AEP workflow)
-
Collect your project by clicking the File menu and choosing Dependencies > Collect Files…
-
Collect Source Files:
- Select For All Comps to include all comps from your project.
- Select For Selected Comps if you'd like to only include specific comps (you will need to select those in the Project panel before collecting). This option will also include any comps nested within the selected comps.
-
Reduce Project: Yes
-
-
Open the folder in which your project has been collected, and select all files and folders.
-
Compress these to a single
.zipfile. You can rename this file if needed.
data-variant=warning
data-slots=heading, text
.zip file must include only one .aep file.Template guide and handover
After exporting your MOGRT or AEP templates, it can be helpful to provide an accompanying guide to help your team's engineers set up the API interaction correctly. This guide can include:
- The type and range of values that each control should expect.
- A relevant description of each control.
- For AEP workflow: The required layer operations. Ideally, you can provide the JSON payload generated with the DGR Panel extension.
It can also be helpful to specify the pixel dimensions and duration of the exported composition.
Note that Dropdown Menu controls are 1-indexed, both when referenced in expressions and by the DGR API (that is, the first option has a value of 1). Your accompanying guide should reflect this. For example, a Dropdown Menu control with three items could be listed as:
1: Apple2: Banana3: Cherry
Any comments or groups in the Essential Graphics panel are currently not readable by the API, so don't rely on these as instructions to the end user.
Suggested MOGRT package contents
.mogrtfile- Font files
- Accompanying guide
- Sample media files for testing (if testing is required)
Suggested AEP package contents
-
.zipfile containing:.aepfile (Adobe After Effects Project)- Project footage (assets) folder
-
Font files
-
Accompanying guide
-
Sample media files for testing (if testing is required)
DGR export profiles
The output video render profiles that we support are:
- Resolution: Up to 3840 x 2160 pixels.
- Frame rate: Up to 60 FPS.
Popular video codec support:
- H.264,
.mp4format - ProRes (with alpha support),
.movand.mxfformats - Apple ProRes 4444 XQ
- Apple ProRes 4444
- Apple ProRes 422 HQ
- Apple ProRes 422
- Apple ProRes 422 LT
- Apple ProRes 422 Proxy
Popular audio codec support: See encoder presets and your export requirements.
DGR Encoder Presets
The following preset IDs are available through the Presets API. For request and response examples, see the sample request on the same page. Expand an item to see the encoder settings JSON for that preset.
data-slots=heading, text, code
ffs_video_api_land_1080p_hq — Landscape 1920×1080 – High Quality
{
"mediaType": "video/mp4",
"codec": "H.264",
"maxFps": {
"numerator": 30,
"denominator": 1
},
"bitrateMode": "vbr",
"targetBitrateInKbps": 8000,
"maxBitrateInKbps": 12000,
"alpha": false
}
data-slots=heading, text, code
ffs_video_api_land_1080p_lq — Landscape 1920×1080 – Low Quality
{
"mediaType": "video/mp4",
"codec": "H.264",
"maxFps": {
"numerator": 30,
"denominator": 1
},
"bitrateMode": "vbr",
"targetBitrateInKbps": 6000,
"maxBitrateInKbps": 8000,
"alpha": false
}
data-slots=heading, text, code
ffs_video_api_square_1080p_hq — Square 1080×1080 – High Quality
{
"mediaType": "video/mp4",
"codec": "H.264",
"maxFps": {
"numerator": 30,
"denominator": 1
},
"bitrateMode": "vbr",
"targetBitrateInKbps": 6000,
"maxBitrateInKbps": 8000,
"alpha": false
}
data-slots=heading, text, code
ffs_video_api_square_1080p_lq — Square 1080×1080 – Low Quality
{
"mediaType": "video/mp4",
"codec": "H.264",
"maxFps": {
"numerator": 30,
"denominator": 1
},
"bitrateMode": "vbr",
"targetBitrateInKbps": 3000,
"maxBitrateInKbps": 4000,
"alpha": false
}
data-slots=heading, text, code
ffs_video_api_vert_1920p_hq — Vertical 1080×1920 – High Quality
{
"mediaType": "video/mp4",
"codec": "H.264",
"profile": "high",
"maxFps": {
"numerator": 30,
"denominator": 1
},
"bitrateMode": "vbr",
"targetBitrateInKbps": 6000,
"maxBitrateInKbps": 8000,
"alpha": false
}
data-slots=heading, text, code
ffs_video_api_vert_1920p_lq — Vertical 1080×1920 – Low Quality
{
"mediaType": "video/mp4",
"codec": "H.264",
"profile": "high",
"maxFps": {
"numerator": 30,
"denominator": 1
},
"bitrateMode": "vbr",
"targetBitrateInKbps": 3000,
"maxBitrateInKbps": 4000,
"alpha": false
}
data-slots=heading, text, code
ffs_video_api_prores — ProRes export preset supporting alpha channel
{
"mediaType": "video/quicktime",
"codec": "Apple ProRes 4444",
"profile": "high",
"maxFps": {
"numerator": 30,
"denominator": 1
},
"bitrateMode": "vbr",
"alpha": true
}
We support predefined social presets or a custom preset (or .epr files). .epr files are exported custom presets from Adobe Media Encoder.
Support for expressions
Expressions are a fundamental part of layer properties and are respected in Dynamic Graphics Render. However, due to the vast range of possible expressions, there may be edge cases that are not supported.
The API supports an English environment. If you're designing in a non-English language version of Adobe After Effects, it's important to universalize expressions to avoid errors. When referencing other properties, you can use Matchnames or indices.
Alternatively, you can use third-party tools such as ExpressionUniversalizer to convert existing expressions to language-agnostic expressions.
DGR is currently compatible with .mogrt and .aep files created in Adobe After Effects 2026 or earlier. Avoid using any expressions that were added to Adobe After Effects after this version. You can check the changelog for expressions.
data-variant=info
data-slots=heading, text
Watch out for processing-heavy expressions like sourceRectAtTime(). Passing a time parameter (for example, sourceRectAtTime(0)) returns the same result on every frame, but the expression is still evaluated on every frame. To evaluate an expression only once, add posterizeTime(0); at the start of the expression (Adobe After Effects 16.0 and later). This can improve render time for text that doesn't change during the render.
Support for Expression Control effects
The following Expression Control effects are currently supported by the DGR API:
- Slider
- Dropdown Menu
- Checkbox
Slider
Value expected by the API: a number (for example, 2.54).
data-variant=info
data-slots=heading, text
Dropdown Menu
Value expected by the API: array index provided as a string, 1-indexed (for example, "1").
data-variant=info
data-slots=heading, text
Checkbox
Value expected by the API: true or false (boolean).
The following Expression Control effects are not currently supported by the DGR API:
- Angle
- Point
- 3D Point
- Color
- Layer
You can use one or more Slider effects in place of Angle, Point, and 3D Point, with appropriately defined ranges of values.
Color
Add a text layer to your comp (hidden or set as a guide layer) and add its Text Source as an Essential Property. You can link Color properties to this Text Source property, using the following expression, to convert text-based Hex color values to RGBA color.
const hexString = thisComp.layer("Color Value").text.sourceText.value;
hexToRgb(hexString);
Layer
You can use a Slider effect in place of this, referring to layers by index.
Alternatively, you can use a Dropdown Menu effect. However, the menu must be manually populated; it will not auto-update when you rename, move, add, or delete layers.
Expressions guide
The following expressions may be helpful for creating flexible templates that adapt to dynamic content, for example, by copyfitting text to fit within specified bounds, or showing/hiding layers based on an expression control's value.
What is copyfitting?
Copyfitting is the process of adjusting text to fit a specific amount of content into a pre-defined space. Examples of this might be ensuring that a text layer's width doesn't exceed that of the composition, or fitting multiple text layers to a multi-column layout.
You define the maximum height and/or width allowed for the text layer. If the content fits within that space, no scaling is applied; if the content's size exceeds these dimensions, the layer is scaled down until it fits.
This ensures that dynamic content always automatically fits within the intended space in the template layout.
What is Paragraph Text and Point Text?
Paragraph Text (or Box Text) is text that has an area of pre-determined height and width into which text can flow. You can create this in Adobe After Effects by dragging an area in a composition with the Text tool.
Depending on the length of the copy, you should usually choose to use this when including text that should wrap onto multiple lines.
Point Text is text that does not have a pre-defined area, but that is instead as wide as the text content, with text only moving onto additional lines when line- or paragraph-break characters are inserted (for example, by pressing Return). The height and width of the text layer are not limited. You can create this in Adobe After Effects by clicking in a composition with the Text tool.
You should use this for text that should be single-line (or for which you want to manually specify where line breaks should occur).
Expression: Center-align to the layer's Position
To center your text layer horizontally and vertically to its Position value, apply the Center Align to Layer Position.ffx preset to the text layer.
Alternatively, you can apply the following expression to the text layer's Anchor Point:
const rect = sourceRectAtTime();
const x = rect.left + rect.width/2;
const y = rect.top + rect.height/2;
[x, y]
To only center horizontally, you can change Line 3 to read:
const y = value[1];
To only center vertically, you can change Line 2 to read:
const x = value[0];
Script: Vertically align Paragraph text
Another option to vertically align Paragraph text is to use the ComposeBoxTextOptions_ScriptUISample.jsx sample script, which utilizes scripting attributes added to Adobe After Effects v24.6 and later. With this, you can select a Paragraph text layer and select Read from Selected Layer, then select your desired alignment (top, center, bottom or justify) and click Apply to Selected Text Layers.
Expression: Copyfitted text based on defined width and/or height
This expression will scale down your text layer if it exceeds a specified width or height. That width or height could be a value defined in your expression (or in a Slider control), or could be based on the width or height of another layer in your project.
Move the text layer's Anchor Point to its vertical center (or align automatically using the above preset or expression), then apply the Copyfit Text.ffx preset to the text layer.
Alternatively, you can apply this expression to your text layer's Scale property:
const widthMax = 500; // Maximum width in pixels
const heightMax = 200; // Maximum height in pixels
const rect = sourceRectAtTime();
const widthCurrent = rect.width * Math.abs(value[0]) / 100; // Width at the layer's current scale
const heightCurrent = rect.height * Math.abs(value[1]) / 100; // Height at the layer's current scale
const fit = Math.min(1, widthMax / widthCurrent, heightMax / heightCurrent); // Shrink only, never enlarge
mul(value, fit)
With either approach, you're effectively defining a box within which the text should scale to fit. The text is only ever scaled down from its current scale, never enlarged.
data-variant=info
data-slots=heading, text
Expression: Copyfitted text based on a guide layer
Rather than copyfitting text to a height and/or width that is hard-coded or driven by Slider values, you can also define the copyfit bounds by the height and/or width of another layer.
To do this, change the first two lines in the code above to the following, ensuring that the referenced layer name is correct:
const guideLayer = thisComp.layer("Guide Layer");
const guideSize = guideLayer.sourceRectAtTime(time, false);
const guideScale = guideLayer.transform.scale;
const widthMax = guideSize.width * guideScale[0]/100; // Maximum width in pixels
const heightMax = guideSize.height * guideScale[1]/100; // Maximum height in pixels
Now, if the size or scale of the guide layer is adjusted, the copyfit bounds will match. This can make it easier to update without later needing to modify expressions.
Typical use cases of this are for any text sitting inside a resizable shape/pill/badge – for example, a date stamp, a price callout, a call-to-action – where the text's width should conform to that of the guide, instead of a hardcoded value.
data-variant=info
data-slots=heading, text
false at the end of sourceRectAtTime(time, false) matters. A false value measures the guide layer's visible content. A true value adds the stroke width for a shape layer, and returns the text box itself (rather than the text) for a Paragraph text layer, which stays the same no matter what the copy says. If you use a Paragraph text layer as the guide and the copyfit bounds don't react when you change its text, this is likely the cause.Expression: Text Box automatically sized to a text layer
To create a box that matches the shape of a specified text layer, create an empty shape layer, and apply the Autofit Text Box.ffx preset to it. This will create a rectangle shape, with the required expressions. Ensure that you select the relevant layer on the Text Layer property of the Autofit Text Box effect. You can further customize the box after its creation (for example, by changing the color or applying additional effects or layer styles).
Alternatively, create a parametric rectangle with the Rectangle tool and add the following expressions to its Rectangle Path 1 properties, making sure to update the textLayer reference to point to your text layer. Leave the rectangle group's own Transform properties at their defaults.
On the Size property:
const textLayer = thisComp.layer("Text Layer 1");
const textLayerSize = textLayer.sourceRectAtTime();
const textLayerScale = textLayer.transform.scale;
const padding = [20, 10];
const x = (textLayerSize.width * Math.abs(textLayerScale[0]) / 100) + (padding[0] * 2);
const y = (textLayerSize.height * Math.abs(textLayerScale[1]) / 100) + (padding[1] * 2);
[x, y]
On the Position property, to center the box on the text's visible bounds (this accounts for the text layer's anchor point and transforms):
const textLayer = thisComp.layer("Text Layer 1");
const r = textLayer.sourceRectAtTime();
fromComp(textLayer.toComp([r.left + r.width / 2, r.top + r.height / 2]))
Expression: Show/hide layers based on a Slider or Dropdown value
If you would like to dynamically turn on/off layers – for example, you have a number of different logos in your template, and you'd like to show a specific one based on the value selected for a Slider or Dropdown control – you can apply the following expression to each layer's Opacity property, making sure to change the value after == for each layer.
const sliderOrDropdownValue = thisComp.layer("Controls").effect("Slider/Dropdown Control")(1); // Connect this to your slider or dropdown control
(sliderOrDropdownValue == 1) ? value : 0
If the Slider or Dropdown value is a match for a layer, the Opacity will be unaffected; if it doesn't match, the Opacity will be set to zero.
You can use a layer's index to make this adaptable to any number of layers. The following can be applied to all layers, without the need to manually change the layer number each time.
const sliderOrDropdownValue = thisComp.layer("Controls").effect("Slider/Dropdown Control")(1); // Connect this to your slider or dropdown control
(sliderOrDropdownValue == index) ? value : 0
If your first layer isn't at the top of the timeline layer stack, but you'd like this to be "on" with a control value of 1, you can subtract from the index. The number that you subtract should be the number of layers that are above the first of these dynamic layers.
(sliderOrDropdownValue == index - 1) ? value : 0
data-variant=info
data-slots=heading, text
Expression: Show/hide layers based on a Checkbox value
This is the simpler sibling of the pattern above – use it when there are only ever two states (for example, show/hide or on/off), rather than several named options. A Checkbox control gives you a true/false switch instead of a numbered menu.
The following expression applied to a layer's Opacity property will keep the layer's Opacity when the checkbox is true, and set it to 0% when it is false.
const checkboxValue = thisComp.layer("Controls").effect("Checkbox Control")(1); // Connect this to your checkbox control
checkboxValue ? value : 0
Typical use cases are for a simple on/off element, such as a Show Badge? or Show CTA? control.
data-variant=info
data-slots=heading, text
Expression: Auto-fade audio at start and end of layer
When using DGR with an AEP template, you can replace audio and video layers with sources of different durations, as well as apply layer operations to adjust layer timing. You can use expressions to read the start and end times of these layers and automatically adjust the volume of those layers to get a smooth fade-in and -out.
Select your layers and apply the Auto-Fade Audio.ffx preset. This will add a number of Slider controls and a Stereo Mixer effect. Expressions applied to the Stereo Mixer effect will, beginning from a layer's start time, fade the audio up from minimum to maximum volume over a specified number of seconds. The audio will then fade down over a specified number of seconds at the end of the layer's duration. You can adjust the slider values to change these settings (by default, 1-second fades between 0% and 100% volume).
Alternatively, create four Slider expression controls and name them as follows:
- Fade In Duration (Seconds)
- Fade Out Duration (Seconds)
- Minimum Volume (%)
- Maximum Volume (%)
Add a Stereo Mixer effect and rename it to Stereo Mixer (Auto-Fade). On the Right Level property, add the following expression. This links the Right Level to the Left Level, ensuring that the volume of both the left and right audio channels are adjusted by the same amount.
effect("Stereo Mixer (Auto-Fade)")(1)
Then, on the Left Level property, add the following expression. If the time is before the start of the layer plus the fade in duration, the audio will increase from min to max. Otherwise, it will decrease from max to min at the end of the layer. The end is the earlier of the layer's out point and the point where the audio source runs out, which accounts for trimmed and time-stretched layers (for example, after a stretch_layer layer operation).
const fadeInDuration = effect("Fade In Duration (Seconds)")(1);
const fadeOutDuration = effect("Fade Out Duration (Seconds)")(1);
const volumeMin = effect("Minimum Volume (%)")(1);
const volumeMax = effect("Maximum Volume (%)")(1);
const layerStart = inPoint;
// Comp time at which the source audio runs out (handles trimmed and time-stretched layers)
const rate = sourceTime(inPoint + 1) - sourceTime(inPoint);
const sourceEnd = (rate > 0) ? startTime + source.duration / rate : outPoint;
const layerEnd = Math.min(outPoint, sourceEnd, thisComp.duration);
// Fade In
if (time < layerStart + fadeInDuration) {
ease(time, layerStart, layerStart + fadeInDuration, volumeMin, volumeMax)
}
// Fade Out
else {
ease(time, layerEnd - fadeOutDuration, layerEnd, volumeMax, volumeMin)
}
How to save and apply animation presets
Animation presets are a great way to save effect stacks and expressions to a user library, so that they can be applied to other layers at a later time. In addition to reducing duplication of effort, it also helps to cut down on user error, ensuring that effects and expressions are always applied as expected.
To save an animation preset file, select one or more properties, effects or layer styles and/or the Effects or Layer Styles section of your layer(s). Go to Animation > Save Animation Preset…, choose your desired save location, then click Save.
To apply an animation preset file (.ffx) to one or more layers, select those layers then go to Animation > Apply Animation Preset…, locate and select the file, and click OK. If you have recently applied this preset, you may also select this from the Animation > Recent Animation Presets list.
If you have saved your preset files to the User Presets folder for your version of Adobe After Effects, you may also be able to find and apply your presets from the Effects & Presets panel.
Referencing a sub-composition safely
If your project ever ends up with two comps that share the same name (easy to do by accident when duplicating a template comp), a direct reference to that comp in an expression – for example, const logo = comp("Logo") – becomes ambiguous. Adobe After Effects will always refer to the first comp it finds with that name, which may not be the one being used in your main comp.
If renaming one of the comps is not an option, this safer method references the composition used by the pre-comp layer that's actually placed in your timeline:
const logo = thisComp.layer("Logo").source;
.source returns the composition itself, so existing expressions such as logo.layer("Title") keep working.