ae-cpp-sdk-architecture

Guides C++ development for After Effects plugins using AEGP suites, threading rules, and memory management.

4|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/ki2pixel/After-Effects-Scripts-Plugins-Bundle --skill ae-cpp-sdk-architecture-ki2pixel
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ae-cpp-sdk-architecture
Source: https://github.com/ki2pixel/After-Effects-Scripts-Plugins-Bundle/tree/main/.windsurf/skills/ae-cpp-sdk-architecture
Command: npx skills add https://github.com/ki2pixel/After-Effects-Scripts-Plugins-Bundle --skill ae-cpp-sdk-architecture-ki2pixel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing C++ plugins for After Effects is error-prone because the SDK forbids standard patterns like new/delete, C++ exceptions across DLL boundaries, and multi-threaded API calls, leading to crashes and memory leaks. ## Core Features & Use Cases - Suite-Based Memory Management: Enforces the AEGP suite handle pattern with RAII wrappers so suites are always released correctly. - Threading Model Guidance: Explains the main-thread rule and the TaskScheduler pattern for safely moving worker-thread results onto the AE main thread. - Error and Handle Lifetimes: Covers PF_Err/A_Err handling without exceptions, plus correct disposal of AEGP_StreamRefH and string marshaling between C++ and Python. - Use Case: When building an AETK wrapper that reads layer names via AEGP_GetLayerName, follow the skill's patterns to acquire suites safely, check error codes, and dispose stream references. ## Quick Start Ask the AI to review or write C++ code for an After Effects plugin that acquires an AEGP suite and reads a layer name following safe SDK patterns.

Frequently Asked Questions about ae-cpp-sdk-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I manage memory in After Effects SDK C++ plugins?▼

After Effects SDK memory management uses host-provided memory suites instead of new/delete. Acquire suites through AEGP_SuiteHandler and wrap them in RAII classes so ReleaseSuite is always called automatically.

How to handle threading in After Effects plugin development?▼

After Effects API calls must run on the main thread only. Use the TaskScheduler pattern: worker threads prepare plain data, push lambdas to the scheduler, and the scheduler executes them on the main thread via an idle hook.

Can I use C++ exceptions in After Effects plugins?▼

No, C++ exceptions must not cross the DLL boundary in After Effects plugins. The SDK returns PF_Err or A_Err codes, which you check after each call and return gently on failure.

Why does my After Effects plugin crash when accessing layer handles?▼

Crashes often come from invalid handle lifetimes: AEGP_LayerH and AEGP_ItemH are only valid during the call, and AEGP_StreamRefH must be explicitly disposed with AEGP_DisposeStreamValue or a scoped wrapper.

How do I pass strings between C++ and Python in AE plugins?▼

Use AEGP_MemHandle for large strings and always define the character encoding explicitly, since AE mixes UTF-8 and OS encodings across legacy versions. Marshal strings carefully when bridging to Python.