mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-14 19:27:05 -04:00
M14.4: scripting with an After Effects-style JavaScript object model
New crate effectcraft-script (L4): boa runtime with app/Project/CompItem/ Layer/PropertyGroup/Property/TextDocument/MarkerValue/RenderQueue/File object model over engine commands (undoable, undo groups), AE match-name table, file/network security gate. Entry points: script.run command, File > Scripts > Run Script File (.jsx/.js), Window > Script Console, effectcraft-cli script, MCP run_script. Engine: project.delete/duplicate, prop.renameGroup/setGroupEnabled/removeGroup/duplicateGroup/moveGroup. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
e911cc5c93
commit
78cd313d3c
36 files changed
+4621
-28
No files matched your search
@@ -49,6 +49,7 @@ The server speaks JSON-RPC 2.0 over stdio, one message per line, and supports MC
|
||||
|---|---|
|
||||
| `list_commands {filter?, enabled_only?}` | Discover command ids, their param docs, and whether each can run now. |
|
||||
| `execute_command {command, params?}` | Run any command (undoable). |
|
||||
| `run_script {code, name?}` | Run JavaScript with the After Effects-style scripting object model (`app.project`, `comp.layers.addText(…)`, `layer.property("ADBE Transform Group").property("ADBE Position").setValueAtTime(…)`…). Returns `{ok, result, output, error: {message, line, column}}`; edits are undoable. |
|
||||
| `get_project` / `get_comp {comp?}` | Project items, comp settings and layers. |
|
||||
| `get_layer {layer, comp?, time?, flat?}` | A layer's property tree. Every node has a `path`. |
|
||||
| `get_property {layer, path, comp?, time?}` | Value at a time, keyframes and expression. |
|
||||
@@ -191,6 +192,19 @@ effectcraft-cli exec file.exportLottie '{"comp":"Main","path":"main.json","inclu
|
||||
effectcraft-cli exec file.importLottie '{"path":"anim.json"}' main.ecproj --save
|
||||
```
|
||||
|
||||
Scripts written against After Effects' documented scripting API run with `script`:
|
||||
|
||||
```sh
|
||||
effectcraft-cli script build.jsx --save-as main.ecproj # empty project unless one is given
|
||||
effectcraft-cli script --eval 'app.project.item(1).numLayers' main.ecproj --json
|
||||
effectcraft-cli script tweak.jsx --bridge 9877 # against the live app
|
||||
```
|
||||
|
||||
`writeLn`/`$.writeln`/`alert` output is printed, then the value of the last expression. A script
|
||||
error exits with status 1 and `file:line:col: message`. Scripts may read files only in the
|
||||
project's folder and may not write files or use the network unless the user turns on Preferences ▸
|
||||
Scripting & Expressions ▸ Allow Scripts to Write Files and Access Network.
|
||||
|
||||
`file.exportLottie` returns `{path, bytes, warnings}`: the warnings list every feature Lottie
|
||||
cannot express (most effects, cameras and lights, layer styles, audio, video footage…), so an
|
||||
agent can check what a player will not show. A `.lottie` path writes a dotLottie archive.
|
||||
|
||||
Reference in new issue
Block a user