Skill 07 · Adobe Illustrator Integrations
Subchapter 7.3
references/cpp-plugins.mdMarkdown5 KBView on GitHub
A plug-in is native code, built with the Illustrator SDK, that Illustrator loads at startup. It can add tools, menu items, live effects, file formats, and notifiers, and it runs much faster than ExtendScript on large documents. It is also the most work to build, ship, and keep current, because it must be rebuilt for each major Illustrator version and each OS.
Choose a plug-in only when a script or CEP panel cannot do the job: a custom tool that reacts to mouse drags, a live effect, a file format, events scripts cannot see, or performance on thousands of objects.
developer.adobe.com/console), open the downloads area, and pick the Illustrator SDK for your OS. Use the SDK whose version matches the Illustrator major version you target.samplecode/, and build tools..aip file on Windows and an .aip bundle on macOS.Plug-ins folder, or better, point Illustrator at a development folder: Preferences > Plug-ins & Scratch Disks > Additional Plug-ins Folder, then restart Illustrator..aip.Every plug-in carries a PiPL (plug-in property list) resource with its name, entry point, and required Illustrator version. Since Illustrator 25.1, PiPL resources are generated by a script in the SDK’s tools folder instead of being edited by hand in resource files (Adobe developer blog, “An Illustrator 25.1 Update for Plugin Developers”). Follow the sample projects’ build steps, which run the generator.
Illustrator calls one exported function with a caller, a selector, and a message pointer. The SDK samples share a common folder: Main.cpp exports the entry point, and the Plugin base class routes caller and selector pairs to virtual methods, so start from a sample rather than writing it yourself:
// Shape of the entry point the SDK samples export; the base class routes
// caller/selector pairs to virtual methods such as StartupPlugin, ShutdownPlugin,
// GoMenuItem, Notify, and the tool handlers.
extern "C" ASAPI ASErr PluginMain(char* caller, char* selector, void* message);Native plug-ins add tools and menu items directly. For panels with complex controls, a common design pairs the plug-in with a CEP panel that sends it events, so the UI is HTML and the heavy work is native. Check the SDK samples for your version for the supported UI approach, since this has changed across releases.
Plug-ins folder