Skip to Content

After Effects best practices

After Effects template for custom projects have no special requirements, you can simply create your template as you would create any video. However, we do have best practices that we recommend you to follow to help you get the best output and have easier time working with the Plainly. These best practices involve formatting of text, images, proper naming structure and similar.

Naming layers

Custom projects often have many layers. In order to be as efficient as possible during the setup, you can put a prefix in front of the layer name, when naming layers that are planed to be dynamic. This way you can easily identify them in Plainly during the parametrization.

Another benefit of having a prefix in front of the layer name is for the use of Auto generate templates in Plainly. If you have a prefix in front of the layer name, and you choose the prefix option in the automatic parametrization, you can then provide the prefix, and all layers with that prefix will be automatically parametrized. This is a great way to save time and effort when working with large projects.

Compositions

When creating a compositions, we suggest you to add a prefix to a rendering composition, for example render_. This way you can easily identify the composition that is used for rendering in Plainly. By prefixing the name of the rendering composition, you can also use it in the automatic parametrization.

Make sure that you don’t add any non-English characters to layer/file names. This will cause failed renders.

Scaling

Scaling ensures your text, images, and videos always look well-positioned and visually consistent across varying input sizes or dimensions. Whether you’re working with dynamic text or media assets, applying auto-scaling methods can help maintain layout integrity without manual adjustment. Below are methods for scaling both text and media elements effectively in After Effects.

Text scaling

We also support the auto-scaling of text through the Text auto scale, that will do the auto-scaling automatically for you.

Depending on what type of text are you using in the template (paragraph or point) you can add the following expressions in order to achieve auto-scaling. When added, the text will automatically scale based on the input, and a defined bounding box.

Paragraph text

If your templates use big lines of text, you are probably using paragraph text (that is bounded by an area), and it probably goes into multiple lines. Create an area that the text should fill, and find a reasonable amount of characters that you think will cover all use cases. If you know all use cases that are then the best-case scenario because you can plan and design accordingly.

Your best chances in keeping this controlled are limiting the number of characters that the user inputs. This is not enforced in any way in After Effects, you just need to provide the number of max amount of characters that each layer can take and notify the user.

In order to keep the text centered at all points, apply the following expression to the anchor point of that text layer.

To the Anchor Point
top = sourceRectAtTime().top; left = sourceRectAtTime().left; x = left + sourceRectAtTime().width / 2; y = top + sourceRectAtTime().height / 2; [x, y];

Point text

If your text is in one line, that means that you’re probably using point text. Point text is very easy to manage, as you can add a simple expression that will automatically scale the size of the text based on the input. Simply create a solid layer named “boundingbox” which will serve as the borders for your text.

If the text goes beyond the borders of this text, it will start scaling down. After you create the solid layer, add the following expression to the scale property of your text layer.

To the Scale property of your text layer
text_width = thisLayer.sourceRectAtTime(time).width; text_height = thisLayer.sourceRectAtTime(time).height; rect_height = (thisComp.layer("boundingbox").height * thisComp.layer("boundingbox").scale[1]) / 100 - 2; rect_width = (thisComp.layer("boundingbox").width * thisComp.layer("boundingbox").scale[0]) / 100 - 2; sTemp = Math.min((rect_width / text_width) * 100, (rect_height / text_height) * 100); s = Math.min(100, sTemp); [s, s];
Text scale expression

If you have multiple text layers in the same comp that need automatic scaling, make sure to create multiple bounding boxes, and change their names in the expression above.

Text background

If your paragraph text has a colored background, and you want the background to scale with text, make sure to apply the following expressions:

To the Anchor Point
yPos = thisLayer.sourceRectAtTime(time).height / 2; [0, yPos];
To the Rectangle Path/Size of the shape that's serving as the background (70px padding)
subText = thisComp.layer("name_of_our_text_layer"); textWidth = subText.sourceRectAtTime(time).width + 70; textHeight = subText.sourceRectAtTime(time).height + 70; [textWidth, textHeight];

Image / video scaling

We also support the auto-scaling of images through the Media auto scale, that will do the auto-scaling automatically for you.

One of the biggest issues when creating templates is scaling images and videos. In a perfect world, all images/videos are the same dimensions, but this usually is not the case. Luckily you can get auto-scaling assets in After Effects.

To begin, each dynamic image or video should reside within its own composition. Think of these compositions as containers that hold the respective media. It’s essential not to apply any effects or keyframes directly to the image or video within these compositions; instead, all adjustments should be made to the composition itself.

The dimensions of these “container” compositions should reflect the maximum size you want the image or video to appear within your project.

We need to add the Scale to Comp effect on each image/video. This effect will automatically scale the image/video according to its container comp.

  1. Download the preset from this link
  2. Paste the preset inside the Documents > Adobe > After Effects (version) > User Presets folder
  3. Apply the effect to every dynamic image/video

When you apply it, you will have a couple of options in your Effect Controls panel, make sure to check the first box, and apply an expression to the second checkbox:

If a composition is vertical
img = thisLayer; imgHeight = img.width; imgWidth = img.height; if (imgWidth > 2 * imgHeight) { 100; } else if (imgWidth <= imgHeight) { 100; } else { 0; }
If a composition is horizontal
img = thisLayer; imgWidth = img.width; imgHeight = img.height; if (imgWidth > 2 * imgHeight) { 100; } else if (imgWidth <= imgHeight) { 100; } else { 0; }
If composition is square, you don’t need to add any expressions, just check the box.
Image scale expression

Color control

If you want to dynamically swap a color of a solid layer, we support that out of the box. Just upload your project, make your solid dynamic, and you will be able to control its colors.

If you want to dynamically swap out colors of other layers (such as shape, text or similar) you will have to set up a color-control layer. This is a text layer in After Effects that will hill hold the HEX value of the color.

Start by adding a new text layer, and type in the hex code of the color (without the #). Then, go to the layer which you will re-color and add the following expression to its color property:

To the Color property of the layer you want to re-color
function hexToColor(theHex) { var r = theHex >> 16; var g = (theHex & 0x00ff00) >> 8; var b = theHex & 0xff; return [r / 255, g / 255, b / 255, 1]; } hexToColor("0x" + comp("control_comp").layer("color_primary").text.sourceText);

Make sure that you reference the right comp and the right layer! You can have as many dynamic colors as you wish, just make sure to create a text layer for each color.

If the layer you want to re-color doesn’t have a color property, you can add a fill effect and then apply the expression to the color property of that fill effect.

Project optimization

When creating templates, you want to make sure that your project is as optimized as possible. This means that you should avoid using heavy effects, and try to keep the number of layers to a minimum.

Pre-rendering

Pre-rendering is the most useful technique for lowering render times. Make sure to pre-render all layers that are using effects, or that are slowing down the preview in After Effects. Also, pre-rendering image sequences will make sure that your project can be under our upload limit. Simply isolate the layers you want to pre-render one by one, and render them out as a mp4. If you have layers with transparency, add a green screen as a background, and key out that green screen in the template. For example: If you use any of Trapcode plugins; pre-compose it; render that composition as a .mp4 sequence and turn off the original layer. You just pre-rendered a composition. This is a huge boost to your render times because AE doesn’t have to calculate heavy layers with complex effects or plugins on it, it just plays a .mp4 video.

Effects and plugins

Effects destroy render times. If speed is important to you, try lowering the amount of the effects/plugins to a minimum, or if it’s possible don’t use them at all.

Expressions

Expressions are also a killer for render times. Especially very complex expressions. After Effects needs to calculate the expression you set every frame, and if it’s a big one you bet it will slow down your renders.

Assets

If you use large assets, they will also affect the render time. Try cropping all the assets in your composition to the right dimensions, instead of using a 4k image or video in a 720p composition.

Resolution

If you are posting to social media, there is no need to use 2k or 4k videos. Research the best dimensions for videos and cut down the resolution if you see that your videos are too big.

Pre-comps

Before finalizing your project, check all pre-comps just to make sure that you don’t have unnecessary files in there. It’s very easy to overlook objects off-screen which will increase your render times. Check everything, clean up, and optimize.

Use .wav for audio

After Effects often has issues with .mp3 audio files. If you are using audio in your project, we recommend using .wav files. This will ensure that your audio is rendered correctly and that there are no issues with the audio quality.

Convert Illustrator/Photoshop files

It’s always a good idea to convert any Illustrator / Photoshop files into .png and .jpg.