Preparing an After Effects project
1. When applicable, click on Source Name to display the Layer Name.
2. You can rename layer names for a clearer overview in templates by right-clicking on a layer and selecting Rename.
3. The Composition Name is used to select the right composition in the Template Studio. Multiple compositions can be added to a project (for example, for different Facebook formats), making it easy to reuse the same ZIP file for multiple templates.
Specific requirements
- Variable text must use an TTF font
A TTF font should be installed on the computer with After Effects when adding text. The same font needs to be uploaded into the Font Library in Marvia (Settings > Platform > Font Library).
- Non-variable layers should be pre-composed
If you plan to use a video (e.g., as a background) or text without a font available in the Marvia Font Library, these non-variable elements must be pre-composed.
Select the non-variable layers you wish to combine.
Right-click on the selected layers.
Select Pre-compose.
Note: Be aware that all selected layers are merged into a single layer. Only select the non-variable content that belongs together, otherwise they will overlap or be overlapped by the variable layers. Do not include any variable layers in the pre-composition, as they will lose their functionality.
- Variable images that should scale
Scale to fill background
If you want a variable image to fill the full background:
Add a default background image, name it
Background.Press the 'S' key to reveal its Scale property.
Alt-click (Windows) or Option-click (Mac) on the stopwatch icon next to the Scale property to open the expression editor.
Copy and paste the following expression into the editor:
const originalScale = value;const compWidth = thisComp.width;
const compHeight = thisComp.height;
const sourceWidth = thisLayer.source.width;
const sourceHeight = thisLayer.source.height;
const widthRatio = compWidth / sourceWidth;
const heightRatio = compHeight / sourceHeight;
const fillRatio = Math.max(widthRatio, heightRatio);
const finalX = originalScale[0] * fillRatio;
const finalY = originalScale[1] * fillRatio;
The expression will automatically scale the image to fill the background. If the image isn't perfectly centered, adjust its position to the middle of the composition.
Scale to fit
If you want a variable image to fit within certain dimensions, for example a logo:
Add a Solid to box the maximum dimensions of the image, name it
Logo Shape.Duplicate this layer and rename the new layer to
Logo.Hide the
Logo Shapelayer.Select the
Logolayer and press the 'S' key to reveal its Scale property.Alt-click (Windows) or Option-click (Mac) on the stopwatch icon next to the Scale property to open the expression editor.
Copy and paste the following expression into the editor
// Replace "Logo Shape" with the name of your solid layer
targetLayer = thisComp.layer("Logo Shape");
targetSize = targetLayer.sourceRectAtTime(time,false);
imageSize = sourceRectAtTime(time,false);
targetRatio = targetSize.width / targetSize.height;
imageRatio = imageSize.width / imageSize.height;
if (imageRatio > targetRatio) { scaleFactor = (targetSize.width / imageSize.width) * 100;
} else { scaleFactor = (targetSize.height / imageSize.height) * 100;
Saving an After Effects project
1. Go to File > Dependencies > Collect File
2. Use these settings and click Collect…
3. Save the folder with your project files, ZIP the contents of that folder (do not ZIP the folder itself), and you’re ready to use it for your template





