Skip to Content

Layer management

This script allows you to control and define different layer properties during the render execution. The script is applied to the layer you want to control, and you only need to provide a parameter name which will be used to pass the layer properties when invoking the render.

Currently, the script supports the following properties:

NameTypeDefault
durationnumber

Duration of the layer in seconds. Must be a positive number or zero. Setting the duration to zero will effectively make the layer invisible.

min: 0

startTimenumber

Start time of the layer in seconds relative to the composition it belongs to.

min: -9900, max: 9900

enabledboolean

Changes the visibility of the layer.

audioEnabledboolean

Turn the layer’s audio on or off.

fontstring

Changes the font of the text layer. If provided, the value must match the PostScript name of one of the fonts packaged in the project or included via fontUrl. If a fontUrl is provided, this field can be left empty, and the PostScript name will be inferred from the font file.

fontUrlstring

URL to a valid .otf, .ttf, or .ttc file that will be fetched at render time. If the font file is a variable font or a font collection (.ttc), the font field can be used to specify which exact variation or face should be used from that file.

fontSizenumber

Changes the font size of the text layer.

min: 0.1, max: 1296

leadingnumber

Changes the leading (line spacing) of the text layer.

min: 0, max: 5000

trackingnumber

Changes the tracking (letter spacing) of the text layer.

min: -1000, max: 1000

widthnumber

Changes the width of a composition in pixels.

min: 1, max: 30000, compositions only

heightnumber

Changes the height of a composition in pixels.

min: 1, max: 30000, compositions only

All supported properties are optional. If they are not provided in the render parameters, the script will not apply any changes to the layer. If you specify a property for non-supported layer type, the script will ignore it.

If you define the parameter with a name my_layer_mng in the script, here is an example a JSON body to provide when invoking the render, in order to set duration of a target layer to 5.5 seconds:

{ "projectId": "5bf8483b-a591-476a-afff-0db5fe1ea70f", "parameters": { "my_layer_mng": { "duration": 5.5 } } }

Here is the extended example with additional properties:

{ "projectId": "5bf8483b-a591-476a-afff-0db5fe1ea70f", "parameters": { "my_layer_mng": { "duration": 10, "startTime": 2, "enabled": true, "audioEnabled": false, "font": "Montserrat-ExtraBoldItalic", "fontSize": 32 } } }

Here is the example that changes composition size:

{ "projectId": "5bf8483b-a591-476a-afff-0db5fe1ea70f", "parameters": { "my_layer_mng": { "width": 1920, "height": 1080 } } }

Using via webapp

Support for the layer management script is also available on the UI. First you need to add the layer management script to a layer that you want to control and save the template.

Layer management script setup

Navigate to the Render form, and you will see your layer management script as part of the parameters. Expand the script and define the changes you want to make to the layer, and hit render.

Layer management in render form with parameters

Layer management parameters also work with batch renders. Either define a column with values for each render, or input a single value that will be applied to all renders.

Layer management in batch render form with parameters

Auto link action, also works with layer management parameters. To perform auto linking you must follow this naming convention:

  • exampleMng - name of the layer management script parameter in the template
  • exampleMng_duration - CSV column name should be, name of the layer management script parameter followed by the property you want to change

Use Generate csv example if unsure about naming convention.