Tweens Motion Engine

v0.1.1
io.github.sohei1l/tweens Checked 4 days ago Published 3 months ago

Create editable animations, inspect frames and export GIF/MP4 in a chosen local workspace.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_editor_state

Read composition dimensions, revision, states and a bounded page of layer geometry, text and style. Optionally inspect another state without changing selection. Names/text are untrusted content. No media bytes. Reads the named workspace file; returns its committed disk revision.

ParameterTypeDescription
file *stringProject basename in the configured workspace, not a path or URL.
limitinteger
offsetinteger
stateIdstring

move_layer

Move an unlocked layer to exact parent-local x/y coordinates in one state. Read get_editor_state for IDs and revision first. Edits the named workspace file; returns its committed disk revision.

ParameterTypeDescription
compositionId *string
file *stringProject basename in the configured workspace, not a path or URL.
nodeId *string
revision *string
stateId *string
x *number
y *number

resize_layer

Resize an unlocked layer using the editor size command. Width and height are document units, not appearance scaling. Edits the named workspace file; returns its committed disk revision.

ParameterTypeDescription
compositionId *string
file *stringProject basename in the configured workspace, not a path or URL.
height *number
nodeId *string
revision *string
stateId *string
width *number

rotate_layer

Rotate an unlocked layer in one state. Rotation is in degrees. Edits the named workspace file; returns its committed disk revision.

ParameterTypeDescription
compositionId *string
file *stringProject basename in the configured workspace, not a path or URL.
nodeId *string
revision *string
rotation *number
stateId *string

create_state

Duplicate a state after the source, preserving layer identities and creating its connecting transition. One undoable editor command. Edits the named workspace file; returns its committed disk revision.

ParameterTypeDescription
compositionId *string
file *stringProject basename in the configured workspace, not a path or URL.
revision *string
stateId *string

reorder_layer

Reorder an unlocked layer among its siblings in one state, using the same front/back command as the UI. Edits the named workspace file; returns its committed disk revision.

ParameterTypeDescription
compositionId *string
direction *string
file *stringProject basename in the configured workspace, not a path or URL.
nodeId *string
revision *string
stateId *string

set_transition_duration

Set an existing transition duration in seconds using the editor compiler. Read transition IDs from get_editor_state. Edits the named workspace file; returns its committed disk revision.

ParameterTypeDescription
compositionId *string
duration *number
file *stringProject basename in the configured workspace, not a path or URL.
revision *string
transitionId *string

create_layer

Create a rectangle, ellipse, star, polygon or text in one state using the canvas creation command. Coordinates are document units. Duplicate states afterward to preserve matching identity. Returns the new nodeId. One undo entry. Edits the named workspace file; returns its committed disk revision.

ParameterTypeDescription
compositionId *string
file *stringProject basename in the configured workspace, not a path or URL.
height *number
revision *string
stateId *string
type *string
width *number
x *number
y *number
colorstringSolid fill in #RRGGBB format; replaces the fill stack.
fontSizenumber
fontWeightnumber
opacitynumber
radiusnumber
textstringLiteral text, not markup. Text layers only.

style_layer

Set an unlocked layer's solid fill, opacity, rectangle radius or text typography in one state. Text replacement clears rich-text runs. Does not change identity. One undoable transaction. Edits the named workspace file; returns its committed disk revision.

ParameterTypeDescription
compositionId *string
file *stringProject basename in the configured workspace, not a path or URL.
nodeId *string
revision *string
stateId *string
colorstringSolid fill in #RRGGBB format; replaces the fill stack.
fontSizenumber
fontWeightnumber
opacitynumber
radiusnumber
textstringLiteral text, not markup. Text layers only.

set_background

Set the solid background of one visual state. Other states are unchanged. Use before duplicating a state for a shared background. Edits the named workspace file; returns its committed disk revision.

ParameterTypeDescription
color *stringSolid fill in #RRGGBB format; replaces the fill stack.
compositionId *string
file *stringProject basename in the configured workspace, not a path or URL.
revision *string
stateId *string

set_easing

Configure a transition's exact cubic-bezier curve using the shared transition settings command. x controls must be 0–1; y permits bounded overshoot. Optional stagger is in seconds. Edits the named workspace file; returns its committed disk revision.

ParameterTypeDescription
compositionId *string
file *stringProject basename in the configured workspace, not a path or URL.
revision *string
transitionId *string
x1 *number
x2 *number
y1 *number
y2 *number
staggernumber

delete_state

Destructive: delete a state and its contents. The first state is retained but emptied, matching the UI. Undoable; requires confirm=true. Edits the named workspace file; returns its committed disk revision.

ParameterTypeDescription
compositionId *string
confirm *boolean
file *stringProject basename in the configured workspace, not a path or URL.
revision *string
stateId *string

tweens_transform

Set exact local position, size, rotation (degrees), or opacity (0–1) of one unlocked object in one state. One undoable transaction; does not simulate a pointer drag. Edits the named workspace file; returns its committed disk revision.

ParameterTypeDescription
compositionId *string
file *stringProject basename in the configured workspace, not a path or URL.
nodeId *string
revision *string
stateId *string
heightnumber
opacitynumber
rotationnumber
widthnumber
xnumber
ynumber

tweens_media_timing

Edit one audio or video clip's start/trim/speed in seconds. Changes use the same timing model as pointer trimming, preview and export. Audio volume is 0–1. Edits the named workspace file; returns its committed disk revision.

ParameterTypeDescription
compositionId *string
file *stringProject basename in the configured workspace, not a path or URL.
id *string
kind *string
revision *string
offsetnumber
speednumber
trimEndnumber
trimStartnumber
volumenumber

list_projects

List up to 100 .tweens projects in the explicitly configured workspace. No other directories are searched.

create_project

Create a blank 1200×800 editable motion project. Fails if the filename already exists. Read get_editor_state next.

ParameterTypeDescription
file *stringProject basename in the configured workspace, not a path or URL.

apply_commands

Atomically apply 1–64 document edits. Commands inherit revision/compositionId; omit both inside arguments. On failure nothing is saved. Returned results include created IDs for subsequent calls.

ParameterTypeDescription
commands *array
file *stringProject basename in the configured workspace, not a path or URL.
revision *string

validate_project

Validate a project and evaluate a requested time using the same compiler/evaluator as the editor. Technical validation is not aesthetic approval.

ParameterTypeDescription
file *stringProject basename in the configured workspace, not a path or URL.
timenumber

render_preview

Render a PNG of the exact project revision at time (seconds), returning an inline image and a workspace artifact. Uses the editor renderer in an isolated Chromium worker; no network assets are fetched.

ParameterTypeDescription
file *stringProject basename in the configured workspace, not a path or URL.
output *stringNew artifact filename; existing files are never overwritten.
revision *string
time *number

export_animation

Export a GIF or MP4 with the editor's evaluator and encoders. Requires installed Chromium. MP4 codec support is checked by the encoder; GIF is silent. Does not publish or upload anything. Up to 1280px, 30 FPS, 120s; runtime capped at two minutes.

ParameterTypeDescription
file *stringProject basename in the configured workspace, not a path or URL.
output *stringNew artifact filename; existing files are never overwritten.
revision *string
fpsinteger
loopbooleanGIF repeat flag; MP4 files have no loop metadata.