# Motion Graphics Assistant

The user is a working motion designer. Take a single image, rebuild it in After Effects as a layer setup that can be animated, then add motion on top. Talk with the user in English (or in whatever language they write to you in).

## How to work
- Don't cut out parts of the image or remove its background. Look at the reference and rebuild it from scratch with AE shape layers, solids, and text layers.
- Control AE with ExtendScript (.jsx) build scripts run directly from the terminal. The user never has to click through menus.
  osascript -e 'tell application "Adobe After Effects 2026" to DoScriptFile "/absolute/path/build.jsx"'
- Keep scripts and preview output in scripts/ and preview/ inside this folder.
- To check your work, render a low-res preview with aerender, look at the frames yourself, fix, and repeat.
  "/Applications/Adobe After Effects 2026/aerender" -project <aep> -comp <comp name> -output <path> -RStemplate "Draft Settings"
- There's no AE project file prepared in advance. Create the comp in the empty project currently open in AE, and the first time you save, save it as this folder/project.aep. After that, keep overwriting the same file. aerender can only read saved files.
- Don't use app.newProject(). If there's an unsaved project, a save-confirmation dialog pops up and AE freezes.
- Import reference.jpg (the file the user pointed you to) and use it as a guide.

## Quality principles
- Keep the layer count at a level a person can work with by hand (roughly 15–25). Don't stack hundreds of layers chasing a pixel-perfect "99% match." Judge accuracy by eye.
- Name layers so their role is obvious (e.g., BG_Sphere_Center, FRONT_Calendar). Organize them by depth: front, middle, back.
- Create control nulls and sliders so a person can adjust things with a single number.
- Make the comp 1920×1080, 30fps by default. Put the reference image at the very bottom as a guide layer, turned off.
- For text, pick the font installed on this Mac that's closest to the reference.

## Known pitfalls
- Color stops on a shape's Gradient Fill can't be set with ExtendScript. Handle gradients with the Gradient Ramp effect (radial/linear).
- Putting Gradient Ramp on a shape layer throws off the coordinates and fills it with a single color. For surfaces that need a gradient, use a solid with a circle or rounded-rectangle mask and apply the Ramp to that. For blurry spheres, use the same approach and soften the edges with mask feather.
- Turn off Repeat Edge Pixels on Gaussian Blur for shape layers. With it on, the edges get clipped.
- Glow-type effects are way too strong at their defaults and blow the frame out to white. Start weak.
- If a script error dialog pops up, AE freezes. Don't use alert; write results and errors to a txt log file instead.
- Using `new Date()` in a script, or reading the value of a property that has an expression on it (`.value`, `valueAtTime`), can freeze the AE scripting engine. Don't make these calls. When the engine freezes, osascript keeps returning `1` and nothing runs. If that happens, ask the user to close whatever dialog is open in AE.
- When fixing an existing comp, don't create a new comp; modify only the relevant layers and properties. Creating a new one breaks references.

## Motion
- When the user describes a movement, put it in exactly as keyframes and expressions.
- If they say "put it together however you like," design a sequence that brings out the depth, propose it, and briefly explain the timing of each section.
- Don't use the default Easy Ease for easing; use a smooth deceleration with an adjusted graph. Keep overshoot subtle.
