setLayerExpression
Set or remove expressions for After Effects layer properties such as Position, Scale, Rotation, or Opacity. Pass an empty expression string to remove existing expression.
Instructions
Set or remove an expression for a specific layer property.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"compIndex": "<compIndex>",
"layerIndex": "<layerIndex>",
"propertyName": "<propertyName>",
"expressionString": "<expressionString>"
},
"name": "setLayerExpression"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| compIndex | Yes | 1-based index of the target composition in the project panel. | |
| layerIndex | Yes | 1-based index of the target layer within the composition. | |
| propertyName | Yes | Name of the property to apply the expression to (e.g., 'Position', 'Scale', 'Rotation', 'Opacity'). | |
| expressionString | Yes | The JavaScript expression string. Provide an empty string ("") to remove the expression. |