apply-effect-template
Apply predefined effect templates like Gaussian Blur, Glow, or Drop Shadow to specific layers in Adobe After Effects compositions, with optional custom settings to override defaults.
Instructions
Apply a predefined effect template to a layer in After Effects
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| compIndex | Yes | 1-based index of the target composition in the project panel. | |
| customSettings | No | Optional custom settings to override defaults. | |
| layerIndex | Yes | 1-based index of the target layer within the composition. | |
| templateName | Yes | Name of the effect template to apply. |
Implementation Reference
- src/index.ts:723-768 (registration)Registers the MCP tool 'apply-effect-template' with server.tool(), including description, input schema, and handler function.server.tool( "apply-effect-template", "Apply a predefined effect template to a layer in After Effects", { compIndex: z.number().int().positive().describe("1-based index of the target composition in the project panel."), layerIndex: z.number().int().positive().describe("1-based index of the target layer within the composition."), templateName: z.enum([ "gaussian-blur", "directional-blur", "color-balance", "brightness-contrast", "curves", "glow", "drop-shadow", "cinematic-look", "text-pop" ]).describe("Name of the effect template to apply."), customSettings: z.record(z.any()).optional().describe("Optional custom settings to override defaults.") }, async (parameters) => { try { // Queue the command for After Effects writeCommandFile("applyEffectTemplate", parameters); return { content: [ { type: "text", text: `Command to apply effect template '${parameters.templateName}' to layer ${parameters.layerIndex} in composition ${parameters.compIndex} has been queued.\n` + `Use the "get-results" tool after a few seconds to check for confirmation.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error queuing apply-effect-template command: ${String(error)}` } ], isError: true }; } } );
- src/index.ts:726-741 (schema)Zod schema defining the input parameters: composition and layer indices, required templateName from enum of predefined effects, optional custom settings.{ compIndex: z.number().int().positive().describe("1-based index of the target composition in the project panel."), layerIndex: z.number().int().positive().describe("1-based index of the target layer within the composition."), templateName: z.enum([ "gaussian-blur", "directional-blur", "color-balance", "brightness-contrast", "curves", "glow", "drop-shadow", "cinematic-look", "text-pop" ]).describe("Name of the effect template to apply."), customSettings: z.record(z.any()).optional().describe("Optional custom settings to override defaults.") },
- src/index.ts:742-767 (handler)The handler function queues the command 'applyEffectTemplate' with parameters to the temporary command file for processing by the After Effects MCP Bridge Auto panel, and returns a confirmation message.async (parameters) => { try { // Queue the command for After Effects writeCommandFile("applyEffectTemplate", parameters); return { content: [ { type: "text", text: `Command to apply effect template '${parameters.templateName}' to layer ${parameters.layerIndex} in composition ${parameters.compIndex} has been queued.\n` + `Use the "get-results" tool after a few seconds to check for confirmation.` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error queuing apply-effect-template command: ${String(error)}` } ], isError: true }; } }
- src/index.ts:156-169 (helper)Helper utility that serializes the tool command and parameters to ae_command.json in the system temp directory, enabling the After Effects bridge script to detect and execute it.function writeCommandFile(command: string, args: Record<string, any> = {}): void { try { const commandFile = path.join(process.env.TEMP || process.env.TMP || '', 'ae_command.json'); const commandData = { command, args, timestamp: new Date().toISOString(), status: "pending" // pending, running, completed, error }; fs.writeFileSync(commandFile, JSON.stringify(commandData, null, 2)); console.error(`Command "${command}" written to ${commandFile}`); } catch (error) { console.error("Error writing command file:", error); }