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:
- Duration - sets the duration of a layer in seconds. Must be a positive number or a zero. Setting a duration of zero will effectively make the layer invisible.
- Start time - sets the start time of a layer in seconds relative to the composition it belongs to. Must be a number.
- Enabled - changes the visibility of the layer.
- Audio enabled - turn the audio of the layer on or off.
- Font - changes the font of the text layer. The value should be set to the font’s PostScript name. Any additional fonts must be included in the project package, unless used with the
fontUrl
property. - Font url - URL pointing to an external font file (e.g., .ttf, .otf). This property must be used in conjunction with the font property and the provided font file must include the PostScript name that matches the value of the font property.
- Font size - changes the font size of the text layer.
- Width (only compositions) - changes the width of a composition in pixels.
- Height (only compositions) - changes the height of a composition in pixels.
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.
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 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.
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 templateexampleMng_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.