Appearance
Automation: window.hm05
Generated page
Copied from docs/2026-11-06-automation.md in the editor repository by pnpm gen. Command keys are the same in the web editor, the desktop app and the MCP bridge AI agents use.
Every action in the editor — hotkey, menu item, panel button, canvas gesture — is a command run by one executor. The same commands are open to scripts and AI agents through window.hm05, so a whole document can be built without moving the mouse, and a picture of the result can be sent back to the model to check.
For chatting with an AI inside the app (it edits the document JSON directly, one undo step per request), see docs/2026-11-02-ai-chat.md.
Open the browser console on the running app (or call it from Playwright / Chrome DevTools Protocol) and use:
js
const r = window.hm05;
r.listCommands(); // [{ key, label, enabled }] — everything registered
r.getState(); // file, stage size, scene, frame, layers, selection, tool, colours,
// view {zoom, scroll}: canvas px = scroll + document units × zoom
r.listElements(); // elements as shown on the current frame (tweens / motion guides applied; motion-tween objects not there left out): { key, type, bounds (layer space), stageBounds? (through the layer's look + what it follows), fill, stroke }
r.getDocument(); // the whole .hm5 document (read-only)
r.getEditorContext(); // tool options / colours (read-only)
r.assetStats(); // { assets, decodedCanvases, stored, deltas, storedBytes } — memory check
await r.projectFiles(); // the document as folder-project files: { "<name>.xh5": base64, "doc.json": …, "images/…": … }
await r.openProjectFiles(files, "name"); // those files → a new document tab (demos/_tools/editor.mjs uses both)
r.sound; // pixi-hm05's sound engine with this document's sounds registered
r.sound.play("boom.wav", { volume: 0.8, loops: 2, effect: "fadeOut" }); // → handle: stop(), seek(t), update(opts), time
r.sound.stopAll();
await r.run("timeline.goto", 12); // one command → { success, error?, label? }
await r.runAll([ // in order; stops at the first failure
["color.setPrimary", "#ff8800"],
["draw.addShape", { rings: [[0,0, 100,0, 100,80, 0,80]], transform: [1,0,0,1,50,50], fill: "#ff8800" }],
["timeline.insertKeyframe"],
]); // → { results, ok, failedAt }
await r.execute({ key: "element.nudge", args: [1, 0], merge: "nudge" });
await r.snapshot(); // PNG data URL of the current frame
await r.snapshot({ maxSize: 512, type: "image/jpeg", frame: 10, area: "content" });
await r.undo(); await r.redo();Rules an agent should know:
- Coordinates are document pixels; the stage is
0,0 → width,height(getState().stage). Frames are 0-based. - Colours are
"#rrggbb"or"#rrggbbaa";"none"= no fill/stroke. - Each successful command that changes the document is one undo step. Pass
merge: "<any key>"inexecute()to fold repeated calls (within 1 s) into one step, as a drag does. - Drawing goes to the active layer at the current frame (
timeline.selectLayer,timeline.goto). Drawing on an empty frame makes a keyframe there. - Selections are
"layerId/elementId"strings — take them fromlistElements()and pass them toselection.set. - Commands return
{ success: false, error }instead of throwing; readerror(e.g. "Nothing selected", "Layer is locked").
Commands by area
Arguments are positional (run(key, arg1, arg2…)).
Drawing
| Command | Arguments | Notes |
|---|---|---|
draw.addShape | { rings, fill?, stroke?, transform?, open?, line?, label? } | rings: polygons as flat [x,y,x,y…] arrays (first = outer, rest = holes). stroke: { color, width } adds an outline. open: true + stroke = a line/path (centre line). transform: [a,b,c,d,tx,ty]. Same-colour fills merge, other colours are cut (Flash merge drawing). |
draw.addText | x, y, width, content | text in the toolbox font/colour |
draw.erase | rings[] | erases the area from loose shapes on the active layer |
paint.bucket | x, y, cell | fills the enclosed area at x,y (cell = grid size in px, 1 is fine) or recolours the fill there |
paint.eyedropper | x, y or "#rrggbb" | picks the fill colour under x,y, or sets the fill colour to a pixel colour the tool read |
color.setPrimary / color.setSecondary | colour | "none" | fill / stroke colour for new shapes; also recolours (or with "none" removes) the selected shapes' fills / outlines |
color.setFillType | "solid" | "linear" | "radial" | "bitmap" | new fills (and selected ones) get a gradient of the Gradient panel's stops, or the bitmap-fill image |
gradient.apply | type, stops? | type: "none" | "linear" | "radial", stops [{offset 0..1, color}] on the selection (replaces a bitmap fill; "none" removes both) |
gradient.setOptions | { spread?, focal?, linearRGB? } | selected gradients: spread "pad" | "reflect" | "repeat", radial focal −0.95..0.95, linearRGB true = blend in linear light |
gradient.set | selectionKey, gradient | replace one selected shape's gradient (x3,y3 = second axis end: ellipse / skew) |
bitmapFill.apply | assetId? | paint the selected fills with an image asset (default: the last picked, else the document's first image); new fills then get it too |
bitmapFill.import | — | file picker (needs a user click) → image asset → applied |
bitmapFill.setOptions | { clamp?, smooth? } | clamp: true = edge pixels stretch on (else tile); smooth: false = nearest-neighbour |
bitmapFill.set | selectionKey, bitmapFill | replace one selected shape's bitmap fill ({ assetId, matrix: [a,b,c,d,tx,ty] }, image px → shape space) |
editor.set | { key: value } | any tool option, e.g. { strokeWidth: 4, shapeFill: true, brushSize: 12 } (the bitmap Brush size is in SCREEN pixels: × view.zoom for document units) |
tool.activate | toolKey | selection, brush, eraser, rectangle, ellipse, line, bucket, text, … (only affects the mouse) |
Selection and transforms
| Command | Arguments |
|---|---|
selection.set | keys[] ("layerId/elementId") |
selection.selectAll / selection.deselect | — |
selection.marquee | {x,y,width,height}, mode? — Flash marquee (cuts partly covered shapes); mode = "new"/"add"/"subtract"/"intersect" (true = add) |
selection.lasso | [x0,y0,x1,y1,…], mode? — the same along a closed outline (world units) |
selection.magicWand | x, y, mode?, tolerance?, contiguous? — on the topmost bitmap-filled loose shape of the active layer under x,y, selects the patch of similar colour (cuts the shape along it); tolerance 0..255 per channel (default the tool's), contiguous false = that colour everywhere in the picture |
selection.sameColor | x, y, mode?, {allLayers?, tolerance?, contiguous?, sample?, hit?}? — the Magic Wand tool on a vector layer (Shift+W): a click on a fill selects every loose fill of that colour / gradient (type + stops + spread) on the active layer (allLayers = every selectable layer), touching or not; on a line, every line of that colour; on a bitmap-filled shape, the similar patch under the click inside that shape (as selection.magicWand, transparent pixels included). hit = line hit distance in world units. On bitmap layers the tool selects pixels instead (no command: the pixel selection is editor state) |
element.nudge | dx, dy (moves the selection) |
element.setTransforms | { key: [a,b,c,d,tx,ty] }, label? |
element.update | keys[], patch (e.g. { opacity: 0.5 }) |
edit.delete, edit.duplicate, edit.copy, edit.cut, edit.paste, edit.pasteInPlace | — |
edit.group, edit.ungroup, edit.distributeToLayers | — |
edit.breakApart | { bitmap?: "shape" | "sprites", gap? }? — bitmaps: "shape" = a rectangle with that bitmap fill, "sprites" = one sprite object per island of opaque pixels (pieces closer than gap px, default 2, stay together); without bitmap and a bitmap selected, the Break Apart dialog asks |
shape.removeBitmapBackground | { mode?, tolerance?, contiguous?, smoothing? }? — smoothing "low"/"medium"/"high"/"pixel" (default the editor's edgeSmoothing, medium); the selected bitmap-filled shapes lose the picture's background: mode "auto" (transparent pixels + the colour along the picture's edge, default) / "transparent" / "edge"; contiguous (default true) = only edge colour connected to the edge |
library.setSpriteSheet | assetId, { cellWidth, cellHeight, count? } | null — cut an image into equal cells (row by row); null = a plain image |
library.placeBitmap | assetId, x?, y?, {newLayer?} — a sprite object (a sprite sheet places one cell); newLayer (or an object layer active) = on a new object layer above |
sprite.setFrame | frame (0-based, wraps) — the cell the selected sprite objects show |
sprite.setBox | width?, height? — the selected sprite objects' box crops / extends (the texture stays put) |
library.colorToTransparent | assetId, { tolerance?, contiguous?, x?, y? }? — the colour at (x, y) (default the top-left pixel) becomes transparent, everywhere (default) or only connected; a new PNG asset (a NEW asset id — read it again before library.placeBitmap) replaces the image everywhere (undoable) |
library.spriteSheetToSymbol | assetId, name? — a sprite sheet → graphic symbol, one keyframe per cell (sprite object, cell centred on the origin); data = the symbol id |
frames.transform | [a,b,c,d,tx,ty], label? — the matrix (layer space) on every object of every keyframe in the selected frames (all selected, unlocked vector / bitmap / motion layers; bitmap pictures via Keyframe.imageTransform); spans are split at the range edges |
frames.offset | dx, dy — the same, a plain move |
sprite.setTexture | { x?, y?, scaleX?, scaleY? } | null — texture offset / scale inside the selected sprite objects' box (null = reset) |
shape.editPoints | layerId, { elementId: patch }, removeIds? — the Subselection tool's write (new world rings per loose shape, like shape.reshape) |
shape.distort | {bounds, corners: [tl, tr, br, bl]} (Distort, perspective) or {kind: "envelope", bounds, points} (9 points row by row, curves), sources? = {selectionKey: element} to warp instead of the current art — rewrites the selected vector shapes / groups (any layers; refused with a symbol, bitmap or text selected) |
subselect.delete / subselect.corner / subselect.smooth | — on the points the Subselection tool (A) has selected: delete them (the edges on each side join), make them corners (handles collapse, straight edges), make them smooth (edges curve through them). edit.delete does the first while that tool is active with points selected |
subselect.nudge | dx, dy — move the selected points (pass merge to make held keys one step) |
arrange.bringToFront / bringForward / sendBackward / sendToBack | — |
align.edge | "left"|"hcenter"|"right"|"top"|"vcenter"|"bottom", toStage? |
align.distribute / align.matchSize | see the Align panel |
Timeline
Layer names are unique per timeline (layers and folders together; no . [ ], not _parent / _root / _top / _children / this): every argument that takes a layer (or folder) id also takes "name:<layer>" — also inside arrays and as the layer part of an object key ("name:arm/<elementId>"), looked up in the timeline shown.
| Command | Arguments |
|---|---|
timeline.goto | frame (0-based) |
timeline.nextFrame / prevFrame / firstFrame / lastFrame / nextKeyframe / prevKeyframe | — |
timeline.insertFrame (F5) / removeFrame (Shift+F5) | — |
timeline.insertKeyframe (F6) / insertBlankKeyframe (F7) / clearKeyframe | — (on an OBJECT layer F7 = a hidden frame — the object still exists for scripts — and F6 on a hidden frame brings the object back as it last showed) |
timeline.selectTime | from, to? — frames of the WHOLE timeline (a ruler click / Shift+drag): every layer, Properties shows the Stage; then insertFrame / removeFrame act on every layer and move the end frame |
timeline.toggleEnd / timeline.setEnd | — / frame | null — the END FRAME (Timeline.end): toggle = on at the playhead's frame (frame 0 → 1) / off; setEnd = the ruler marker (clamped 1 … length; null = off). That frame and later ones are not played or exported |
timeline.createTween / removeTween | easing? — a classic tween on a layer holding one object (≤ 1 per key) makes it that object's object layer |
timeline.setEasing | layerId, frame, easing, keepChannels? — easing {kind:"bezier", points:[x1,y1,x2,y2]} = a custom curve, {kind:"curve", keys:[{t,v,inTan?,outTan?}]} = custom points; without keepChannels the per-channel / property curves reset |
timeline.setChannelEasing | layerId, frame, channels[], easing | null — channels x y rotation scaleX scaleY alpha |
timeline.setPropertyEasing | layerId, frame, keys[], easing | null — keys "color", "filter", "filter.<type>", "filter.<type>.<param>" (e.g. "filter.blur.blurX"); a key falls back to the broader one, then the main easing |
timeline.createCurveTween | — the frame selection (else the span at the playhead) of each selected / the active vector layer becomes ONE curve tween span (曲線補間): no end key, each property of each object on its own curve. Keys / classic tweens inside it become curve keys (objects followed like a classic tween pairs them); a lone key is stretched over the selection. Then ANY edit on a frame of the span (move, rotate, scale, alpha, brightness, mesh points) adds keys only on the channels that changed |
curve.setTrack | layerId, frame, elementId, channel, keys | null — one curve of the curve tween covering frame. Channels x, y, rotation, skew (degrees), scaleX, scaleY (1 = 100 %), alpha (0..1), brightness (-1..1), mesh.<i>.x / mesh.<i>.y (mesh point i as drawn, 0-based), text (text objects: keys hold s = the string, v = step 0, 1, 2 …; numbers count, added / removed characters type in / out), frame (symbol instances: TIME REMAP = the inner frame shown, stored 0-based, fractions between frames; overrides first frame / loop / speed / reverse / own clock; past the end it wraps, held with play once). Keys {p, v, s?, ease?, in?, out?}: p = where in the span, 0 = its first frame, 1 = its LAST frame (frame = p × (length − 1); keys are shares so F5 / Shift+F5 inside the span stretch / squeeze every curve), ease absent = smooth (the default curve), "hold", or an easing spec for the stretch to the next key ({kind: "preset", name: "linear"}, {kind: "bezier", points: [x1, y1, x2, y2]}; a bare name is refused); in / out = hand-set slopes (value per whole span, i.e. per unit of p). null / [] = no curve |
curve.setTracks | layerId, frame, [{elementId, channel, keys | null}] — several curves, one undo step |
curve.movePathKey | layerId, frame, elementId, p, x, y — the stage motion path: the object's translation at p (share of the span) = (x, y); x / y keys there |
curve.movePathHandle | layerId, frame, elementId, p, side, x, y, broken?, anchor? — a path key's handle (side "in" / "out") dragged to stage point (x, y): sets the x / y in / out slopes at p (both keyed there first, the curve unchanged). Smooth (default): the other handle turns in line, keeps its length; broken = that side only (Alt). Handle = key point ± speed × gap to the next path key / 3 (Bezier-like). anchor = the point of the object the path follows (own space; default a symbol's pivot / the content centre). A stretch that had an easing becomes smooth. Pass merge for a drag = one undo step |
curve.setPathKind | layerId, frame, elementId, p, "smooth" | "corner" | "linear" — Smooth = automatic slopes, no eases either side; Corner = each side's slopes aim straight at the neighbouring key (a sharp turn, e.g. a bounce); Linear = straight stretches both sides (linear eases) |
curve.addPathKey | layerId, frame, elementId, p — x and y keys at p without changing the path (refused when both have one there) |
curve.removePathKey | layerId, frame, elementId, p — the x / y keys at p removed (other channels kept) |
timeline.moveTweenPathKey | layerId, keyIndex, elementId, x, y — a CLASSIC tween's key square on the stage: the object in the keyframe starting at keyIndex moved to translation (x, y) |
timeline.keyTweenFrame | layerId, frame — a frame inside a classic tween becomes a keyframe showing what it showed (double-click on its motion path) |
curve.setLoop | frame? — loop frame of the selected objects of the curve tween at the playhead (none selected = all of the active layer's): back at the first frame's pose there, repeating on. Default = the playhead |
curve.clearLoop | removes their loop frames |
mesh.convertEach | layout? — one mesh object per selected object (loose shapes together) |
curve.keyFrame | layerId, frame, [[elementId, channels?], …] — keys at frame holding the values shown (no channels = every curve the object has) |
curve.setRemap | layerId, frame, elementId, value | null — TIME REMAP (owner 2026-11-23): the symbol instance shows inner frame value (stored 0-based, fractions allowed, may pass the end — wraps) at frame = a frame key there (new keys Linear; the first one also keys the span's first frame with where it played then); null = no time remap (plays as first frame / loop say). Properties → Playback "Time remap" |
shape.addHint / shape.removeAllHints | — (shape tween under the playhead; Ctrl+Shift+H) |
shape.moveHint / shape.removeHint | layerId, keyIndex, hintIndex, x?, y? |
timeline.setLabel | layerId, frame, label | null (unique per section) |
timeline.setSection | layerId, frame, name | null — names the section a key of the section layer (layer.add "section", one per timeline) starts; unique per timeline |
state.addTransition | from | null (any state), to, {when?: [{input, op?, value?}], end?, index?}? — STATE MACHINE (gap plan #1): an arrow between sections of the current scene (its section layer's transitions); input = an Input's name or id (saved as the id), op < <= > >= == != (none = the Input is on / fired), end = at the section's last frame; nothing given = end: true (any state: the first trigger) |
state.updateTransition / state.removeTransitions / state.moveTransition | index, transition / indices[] / from, to — by index in the section layer's transitions (= priority) |
section.share | section, toSymbolId | "root", fromSymbolId? — Share Animation: that section of the edited timeline (or from) copied onto the other symbol, parts matched by name (bones, IK constraints, vector layers); the target's section of that name replaced / made; what matched → Output panel. section.shareDialog section? opens the dialog |
timeline.moveKeyframe | layerId, from, to |
timeline.setKeyframeLength | layerId, frame, length |
timeline.selectLayer | layerId, mode?, withFrames? — mode "set" / "toggle" / "range"; withFrames = also select all frames of the selected layers (a click on the layer name) |
layer.add | "vector" | "bitmap" | "motion" | "label" | "script" | "sound" | "adjustment" (the camera is switched on with camera.toggle; "adjustment" = a vector layer with adjustment on and one adjusting key: its keys adjust the rows below it) |
camera.toggle | on? — the camera on / off (one per scene of the main timeline; the first time it frames the stage exactly) |
camera.setFrameSize | width, height — the frame in pixels = export size / aspect (turns the camera on) |
camera.setPose | {x?, y?, rotation?, scale?, easing? | null}, frame? — x / y = frame centre, rotation in radians, scale > 1 zooms in, `persp: |
camera.nudge / camera.reset | dx, dy / — (a key here framing the whole stage) |
layer.toggleMask / layer.toggleMasked | layerId? — Flash mask layer / masked by the mask above (toggleMasked also takes a folder id: the whole folder is masked as one group). A new mask already masks the row right under it — a folder too, so toggleMasked on it afterwards turns it OFF |
layer.setMaskOptions | layerId?, {mode?: "shape" | "alpha" | "luminance", invert?: boolean} — what of a mask layer's art masks (shape = anything drawn, alpha = its alpha, luminance = its grey level, white = shown) and whether the masked rows show outside it instead |
layer.convertToBitmap | layerId? — every keyframe's art painted into a stage-sized picture |
layer.convertToVector | layerId?, opts? — no opts = the dialog; opts {mode: "layer" | "copy", frames: "all" | "current" (copy only), as: "bitmap" | "shape"}: the layer itself or a new vector layer above, every picture (or the one at the playhead) as one bitmap object or a rectangle with the picture as bitmap fill (no tracing) |
layer.convertToObject | layerId?, name? — a free layer holding one symbol / text / bitmap / group per keyframe becomes its OBJECT layer (one object for the whole timeline, named by the layer) |
layer.convertToFree | layerId?, confirmed? — back to a free layer; without confirmed the dialog lists what is lost (name lookup, hidden frames, triggers, scripts, children — released in place) |
object.toOwnLayer | targets?, name? — the selected object gets an object layer of its own (in place when its layer holds nothing else, else moved with its tween chain to a new layer above) |
edit.distributeToLayers | — every selected object onto a layer of its own (symbols / text / bitmaps / groups = object layers) |
layer.setParent | layerId?, parentId | null, keep = true — OBJECT PARENTING: the layer follows the object of an object layer (move / turn / scale / skew), hides where it is hidden; keep = stays in place |
layer.setParentLook | layerId?, on — the parented layer also takes the parent's alpha / Visible |
layer.followFrom | layerId?, target | null, frame? — FOLLOW SWITCH (vector / bitmap layers): from frame (default the playhead) the layer follows target = {parent: objectLayerId}, {parent: boneLayerId, bone: boneId} or {} (nothing: it stays where it is); makes a key there (F6) when there is none; never jumps on screen. null = remove the switch on that key |
layer.rename / layer.delete / layer.duplicate / layer.toggleVisible / layer.toggleLock / layer.move / layer.moveBefore / layer.setProps | see listCommands() |
layer.setProps | layerId, { guide?, adjustment?, blendMode?, opacity?, cameraSpace?, lockAlpha?, maskLinked? } — adjustment = ADJUSTMENT LAYER (free vector layers only): its art is not drawn; each key's adjust (filters / colour effect / blend, alpha = strength) applies to the rows below it in its folder, an empty key (F7) adjusts nothing, a classic tween blends two keys; layer.setLook on it writes the key at the playhead; a mask above it limits the area |
layer.setStageAnchor | layerIds? (id | id[] | null = the active layer), { x: "left" | "center" | "right" | "stretch", y: "top" | "middle" | "bottom" | "stretch" } | null — STAGE ANCHOR (gap plan #17, visual layers of the MAIN timeline): published at another page size the layer keeps its distance to that edge / the centre, or stretches; null = moves with the stage. Read it back from getDocument() (Layer.stageAnchor) |
scene.add / scene.select / scene.rename / scene.delete | — |
playback.toggle | — |
playback.setFrameActions | layerId, frame, actions[] — a playback layer's (layer.add "script") actions at a frame (made a keyframe if needed). Action = {type:"call", script, fn, args?} (a function of the target's script), {type:"stop"|"play"|"togglePlay"|"stopAll"|"nextFrame"|"prevFrame"|"nextScene"|"prevScene"}, {type:"scene", scene, then?} (alone = the scene's first frame; right before a goto / playTo = that one looks there), {type:"goto", section?, frame, then?:"play"|"stop"}, {type:"playTo", section?, frame} (forward or backward, stops there, never into another section; frame may be "@start" / "@end" of the section); the list is a chain — a playTo / wait holds the rest until done, {type:"setFps"|"resetFps", scope:"global"|"self", fps?, duration? /* s */}, {type:"stopSounds"}, {type:"playSound"|"stopSound", sound}, {type:"setVisible", visible}; frames are 0-based numeric strings or labels. Who they act on = a {type:"target", target} step before them (_parent, _root, _children[0], an object (object layer) name / instance id, dotted; steps in a row add up: [{type:"target",target:"a"},{type:"target",target:"b"},{type:"stop"}] stops both; none = the running timeline). Also {type:"canned", kind /* fadeIn, fadeOut, slideIn, slideOut, popIn, popOut, pulse, shake, spin, blink */, seconds, params?} (players only) |
instance.setActions | trigger, actions[], targets? — "click" / "pointerOver" / "pointerOut" / "key:<KeyboardEvent.code>" (e.g. "key:Space") on the selected instances' OBJECT layers (targets = selection keys or layer ids; objects on free layers have none — default target = the instance); [] removes. More actions: {type:"overlay", section /* "" = stop */, parts? /* "arm_R/*, head" */, loop?} (players only: that section of the target's timeline on those parts, the rest plays on — pixi-hm05 clip.overlay), {type:"repeat", frame, times}, {type:"gotoRandom", frames[], then?}, {type:"wait", seconds}, {type:"setDirection", backward}, playSound + onEnd: actions[], {type:"openUrl", url, blank?} ("click" lists only) |
instance.setName | name, targets? — names the selected object (symbol / text / bitmap / group): on a free layer it gets its own object layer of that name (bound in place when the layer holds only that object, else moved with its tween chain above; a taken name is refused); on an object layer it renames the layer. element.update with {name} does the same |
symbol.setStopAtEnd | symbolId | null, on — null = the symbol being edited; plays once and holds its last frame |
instance.setClock | "synced" | "independent" | null, targets? — the selected instances' timeline sync: synced = their frame follows the parent timeline (Flash graphic; scrubbing shows it), independent = their own clock (Flash movie clip; keeps playing when the parent stops, the editor shows the first frame); null = the symbol's default (symbol.setIndependentClock). Stored as playback.independentClock only when it differs from that default |
symbol.setIndependentClock | symbolId | null, on — the symbol's default sync for instances without their own setting |
Layer effects (layer look, layer tween, canned motions)
A layer's alpha, visibility ("Visible" = drawn in the published file; the timeline eye only hides it while editing), blend mode and filters apply in the editor AND every export / publish. A layer tween is a row under the layer that keys those plus position / rotation / scale; canned motions are ready-made moves over a frame range (bars above the layer) that move the whole layer about its art's centre without touching keyframes.
| Command | Arguments | Notes |
|---|---|---|
layer.setLook | { alpha?, visible?, blendMode?, filters?, x?, y?, rotation?, scaleX?, scaleY? }, layerId? | at the current frame; with a layer tween the key covering it is edited; transform keys need a layer tween. rotation in radians, filters = [{type, params}] |
layer.addTrack / layer.removeTrack | layerId? | add / remove the layer tween row (removing keeps the look at the playhead) |
layerTrack.select | layerId, frame? | focus the row: F6 / Shift+F6 / Create / Remove Tween then work on it |
layerTrack.insertKey / layerTrack.removeKey | layerId?, frame? | |
layerTrack.moveKey | layerId, from, to | |
layerTrack.createTween / layerTrack.removeTween | — | on the focused row at the playhead |
layerTrack.setEasing / .setChannelEasing / .setPropertyEasing | like timeline.set…Easing with the key's frame | blend and visibility always switch at the next key |
canned.add | kind, { layerId?, owner?: "layer" | "track", start?, length? }? | kinds: fadeIn fadeOut slideIn slideOut popIn popOut pulse shake spin flip spin3d blink (flip / spin3d = 3D turn of the whole layer: axis x / y, angle, back, turns); default range = the frame selection, else 12 frames from the playhead |
canned.update | layerId, id, { kind?, start?, length?, params?, easing? | null } | params merge (e.g. { direction: "top", distance: 300, bounce: 0.6 }) |
canned.remove / canned.select | layerId?, id? | |
canned.bind / canned.unbind | layerId, id, keyLayerId, frame / layerId, id | "Start with key": the bar's start locked to the keyframe starting at frame on keyLayerId (same timeline) — it moves with that keyframe; moving the bar by hand unlocks it |
text.setAnimation | kind | null, { layerId?, start?, length? }? | TEXT ANIMATION (gap plan #8) of the selected texts' layers over their keyframe span at the playhead (a text bar there changes preset; null removes it; new bar: typewriter ≈ 15 letters/s, wave = the span, others 1.5 s). Kinds (also for canned.add, vector layers only): textTypewriter textPopIn textWave textFadeIn textSlideUp; params (canned.update): by letter / word / line, order forward / backward / center / edges / random (+ seed), fit (spread over the bar, default on) or stagger frames, duration frames each, delay; pop from bounce turn fade; slide distance fade; wave amplitude period spread ramp |
Bitmap pictures
Active bitmap layer, current frame. Painting itself is a pointer gesture (brush — its Type can be Smudge / Blur — / eraser / bucket); the pixel selection is editor state made with the Selection Brush tool.
| Command | Arguments |
|---|---|
bitmap.selectAll / bitmap.invertSelection | — pixel selection |
bitmap.nudgePixels | dx, dy (document units, at least one picture pixel) — moves the selected pixels |
bitmap.copyToSubLayer (Ctrl+J) / bitmap.cutToSubLayer (Ctrl+Shift+J) | — selected pixels to a new sub-layer above (no selection: duplicate the sub-layer) |
bitmap.mergeDown / bitmap.flatten | — active sub-layer onto the one below / all visible sub-layers into one |
bitmap.addSubLayer / bitmap.removeSubLayer / bitmap.setActiveSubLayer / bitmap.reorderSubLayer / bitmap.setSubLayerProps | see listCommands() |
bitmap.setSubLayerTransform | matrix | null, subId? — one sub-layer's own matrix [a,b,c,d,tx,ty] (layer space → picture space; the pixels are not touched); null resets. bitmap.applySubTransform(subId?) bakes it into the pixels (needed before painting on a scaled / turned sub-layer) |
bitmap.placePicture | pictureId | {assetId}, at?: {x, y} — another picture (a bitmapImages id) as a picture sub-layer, or a Library image as a pixel sub-layer, above the active one; an empty frame gets a new picture. bitmap.rasterizeSubLayer(subId?) turns a picture sub-layer into pixels |
bitmap.unlinkSubLayer | subId? — the sub-layer stops sharing its pixels with the other keyframes' copies (a picture several keyframes show is copied for the keyframe on its first change; pixel sub-layers stay linked) |
bitmap.editCanvas / bitmap.confirmCanvas / bitmap.cancelCanvas | {x?, y?, width?, height?}? — start (default = the stage) or change the pending canvas (picture space), then make it the canvas limit of every picture on the layer / drop it |
bitmap.setLimit | on? — the canvas limit as it is (off = pictures grow with what is painted) |
picture.rename / picture.delete / picture.deleteUnused | pictureId, name / pictureId (unused only) / — |
Filters
On the selected symbol instances (index = position in the first selected instance's list). Kinds and parameters: FILTER_DEFS in @hm05/document (dropShadow, blur, glow, bevel, outline, adjustColor, bloom, motionBlur, pixelate, rgbSplit, noise, innerShadow, gradientOverlay, gradientGlow, gradientBevel, zoomBlur, spinBlur).
| Command | Arguments |
|---|---|
element.set3d | patch | null, targets? — 3D pose of the selected instances / bitmaps / text / groups: {rx, ry, z, back: "mirror"|"hide"|"color", backColor, shade (0..1 darken by angle), own: {fov, dx?, dy?} | null} (degrees; z + = further); null = flat again |
instance.setInnerPerspective | fov | null — the perspective of the 3D inside the selected instances (vanishing point = their transform point) |
scene.setPerspective | {fov?, center?: {x, y}} | null, sceneId? — the scene's global 3D perspective (default 55°, stage centre) |
symbol.setPerspective | symbolId, {fov, center?} | null — the perspective of the 3D inside a symbol |
filter.add | type, params? — e.g. "glow", { color: "ffcc00", distance: 12 }; "waveWarp", { speed: 1, pinning: "left" }; "levels", { outWhite: 180, bGamma: 1.2 }; "curves", { rgb: "0:0,64:44,192:214,255:255" } (kinds + params: document FILTER_DEFS) |
filter.set | index, params — changed parameters only (clamped to their ranges) |
filter.remove / filter.setEnabled / filter.move | index / index, on / index, to |
filter.setAll | [{ type, params, enabled? }, …] — replaces the list |
filter.setAllEnabled | on (every filter of the target) |
filter.clear / filter.copy / filter.paste | — |
To animate a filter, give both keys of a classic tween the filter with different values (a filter on one key only fades in / out); timeline.setPropertyEasing sets each value's curve.
Symbols and library
| Command | Arguments |
|---|---|
symbol.convert | name? — the selection becomes a symbol instance (F8) |
slots.newProfile | {id?, name?, folder?, extends?} — a slot profile (a Library symbol edited as a mind map: symbol.edit / symbol.openTab); extends = built on that profile (shows its circles + items, holds only its own copies / additions) |
slots.addCircle / slots.setCircle / slots.removeCircle | profileId, {id?, name, parent?, x, y} / profileId, circleId, {name?, parent?: id | null, x?, y?} / profileId, circleId — circles = categories (names never contain - : *); full item name = circle names + item name joined by - |
slots.register | profileId, circleId? — the selected stage objects (not loose shapes) become items of the profile (in that circle) and show them from now on; a mesh object / group gets its content's centre as pivot |
slots.setItem / slots.place / slots.removeItems | profileId, itemId, {name?, circle?: id | null, pivot?: {x, y} | null, isDefault?} / profileId, {items?: {id: {x, y}}, circles?: {id: {x, y}}} (mind map places) / profileId, itemIds |
slots.addMeshItem | profileId, {at, circle?, name?, itemId?} — a blank item: a mesh object over a new symbol with a blue 128 square |
slots.switch | layerId, elementId, itemId — the object shows another item of its profile from the playhead on (on a key = in place; inside a Motion Tween = a swap: the old object ends, a copy showing the item takes over; the new one is selected) |
slots.override | profileId, baseItemId, {itemId?, keepSelection?}? — in an extending profile: its own copy of a base item (a mesh / instance over a symbol gets a COPY of the symbol to redraw; the mesh stays the base's) |
slots.setProfile / slots.unlink | layerId, elementId, profileId (see the item through another profile of the family) / — (the selected objects become ordinary objects) |
slots.setRules | layerId, elementId, [{profile, match?, off?}] | null — dress-up rules of an object (it and everything inside, any depth): its slot objects show the same-named item of profile (match with *, e.g. "HEAD*"; later rules win, outer objects win; a missing name = the nearest one) |
symbol.new | name? |
symbol.edit / symbol.exitEdit | symbolId / levels? |
symbol.openTab / symbol.switchTab | symbolId / symbolId | null — the edit bar tabs: open (or show) a symbol as its own tab; switch to a tab, null = the main timeline. Each tab keeps its frame / layer / in-place path |
symbol.closeTab / symbol.closeAllTabs | symbolId? (default: the active tab) / — — closing the active tab shows the one before it; close all = only the main timeline |
library.setDetails | ids, {exportId?, loadLevel?, separateFile?, exportAs?, stopAtEnd?, frameBase?, independentClock?, perspective? ({fov, x?, y?} | null), preserve3d? ("sort" | "keep" | null)} — Library › Details…, one undo step for all ids (exportId: one id only) |
library.placeInstance | symbolId, x?, y?, {newLayer?} — newLayer (Ctrl held while dropping from the Library) or an object layer active = on a new object layer above |
symbol.rename / symbol.delete / symbol.duplicate | id, … |
Values (named values of a timeline — docs/features/values.md)
owner = a symbol id, null = the main timeline, "@globals"; left out = the timeline being edited. Formula text is given as typed (hp * 200, @head.rotation); it is saved with ids. Rows are in getDocument().values / .globals / .library[id].values.
| Command | Arguments |
|---|---|
values.addInput | type = "number" | "switch" | "trigger" | "point" | "text" | "color" | "option", {owner?, name?, index?, folder?, id?} — a trigger is on for one beat after values.try(id, true) / code fires it (state machines) |
values.addFormula | text, {owner?, name?, index?, folder?, id?} |
values.addRef | {layerId, elementId?, channel}, {owner?, name?, index?, ownLayer?, id?} — channel: x y rotation scaleX scaleY skew alpha, or layer.alpha; an object on a free layer needs ownLayer: true (it is moved to an object layer in the same step) |
values.update | id, {name?, folder?, type?, default?, min?, max?, step?, options?, expr?, channel?}, owner? (null removes an optional field) |
values.remove / values.duplicate | ids[], owner? |
values.move | ids[], index, owner?, folder? |
values.try / values.resetTry | id, value, owner? / ids[]? — a trial value of an Input (never saved; colour = "rrggbbaa", point = {x, y}) |
values.setDefault | ids[]?, owner? — the tried values become the saved defaults |
values.combine | a, b, op, {owner?, name?, id?} — a new Formula a op b; a / b = {from: "row", owner, id} or {from: "field", layerId, channel}; op = + - * / or map |
values.setInput | layerId, elementId, inputName, value | null — what THIS instance gives an Input of its symbol (null = the default); on an object layer every key's instance gets it |
Bind — a property of an object that has a layer of its own follows a formula (getDocument()…layer.binds = channel → formula as saved). Channels: x y rotation scaleX scaleY skew alpha (alpha 0..1), visible, text (a text object), progress (0..1: the frame a symbol shows), in.<rowId> (an Input of the symbol shown). In a bind value = what the timeline says.
| Command | Arguments |
|---|---|
bind.copyTransform | layerId, sourceId, {channels?, mix?, keepOffset?} — COPY TRANSFORM (a transform constraint): the object of layerId copies channels (default ["x", "y", "rotation", "scaleX", "scaleY"]) of sourceId's object, one bind each, one undo step; keepOffset (default true) = it stays where it is now (offset added / scale multiplied); mix 0..1 (default 1) → lerp(value, …, mix). Both must be object layers |
bind.set | {layerId, elementId?}, channel, text | null, {ownLayer?, mode?, createInputs?} — text as typed ("hp * 200", "=value + wiggle(2, 3)"); null = unbind; ownLayer: true moves a free-layer object to its own layer first; mode = "replace" (default) / "add" / "multiply" onto an existing bind; a name no row has becomes a number Input unless createInputs: false |
bind.release | layerId, channel — unbind and keep what the formula gives now |
bind.toValues | layerId, channel, {name?, id?} — the formula becomes a named Formula row, the property reads that row |
view.toggleBinds | — binds on / off on the stage (off = as the timeline says) |
Bones (bone layers — docs/features/bones.md)
A bone layer is a layer of type "bone" (layer.add "bone", or the first bone.add makes one); its bones are in layer.bones.bones, keys in layer.bones.tracks. layerId left out = the bone layer bones go to (the picked bones' layer, else the active one, else the first editable one).
| Command | Arguments |
|---|---|
bone.add | {origin: {x, y}, tip: {x, y}, parent?, name?, layerId?, id?} — as shown at the playhead, in the timeline's space; parent left out = the bone picked last, null = a root; the new bone is picked |
bone.select | layerId | null, ids[], mode = "set" | "toggle", {keepObjects?} — keepObjects: the selected objects stay selected (a mesh object + the bone to paint) |
bone.pose | layerId?, {boneId: {x?, y?, rotation?, scaleX?, scaleY?, length?}}, {rest?, frame?} — POSED values (rotation in degrees); keyed at the playhead, or with rest: true made the rest pose |
bone.resetPose / bone.removeKeys | layerId?, ids[]? / layerId?, frame?, ids[]? — the picked bones at the playhead |
bone.moveKeys | layerId, from, to, {copy?, boneIds?} |
bone.setTrack / bone.setTracks | layerId, boneId, channel, keys | null / layerId, [{boneId, channel, keys}] — keys {f, v, ease?, in?, out?}, v = OFFSET from the rest pose; channel "mix" with a constraint id = that IK constraint's mix curve (v = the mix itself, 0..1) |
bone.rename / bone.setParent / bone.setProps / bone.delete | layerId, boneId, name / layerId, boneId, parentId | null / layerId, ids[], {inheritRotation?, inheritScale?, color?, limit?} / layerId?, ids[]? |
layer.setParentBone | layerId?, boneLayerId | null, boneId | null, keep = true — the layer's art follows that bone as one piece |
bone.copyPose / bone.pastePose | — / mirrored? — the picked bones' (none picked: every bone's) pose at the playhead; paste keys it at the playhead, true = onto the bones named for the other side (arm_L ↔ arm_R, left ↔ right), turned the other way |
bone.setExpanded | layerId, expanded? — the timeline shows a row per bone (left out = toggle; not an undo step) |
bone.setRootMotion | layerId, {bone, x, y, travel?} | null — ROOT MOTION: that bone's travel on the axes picked is taken out of what is drawn (walks in place) and handed to the game (pixi-hm05 clip.rootDelta); travel: true = the EDITOR draws the travel anyway (preview); null / no axis = none |
IK constraints (layer.bones.constraints, solved in list order after the keys):
| Command | Arguments |
|---|---|
bone.addConstraint | {layerId?, tip?, target?, count?, name?, bend?, mix?, stretch?, id?} — the chain = count bones ending at tip (default 2, 1 for a root bone); defaults = the picked bones: the first is the tip, the second the target; one picked bone = bone.pinHere |
bone.pinHere | layerId?, boneId? — a target bone (a root) at the bone's tip + the IK constraint, one undo step; the target is picked |
bone.updateConstraint | layerId, constraintId, {name?, target?, count?, bend? (1 | -1), mix?, stretch?} |
bone.setConstraintMix | layerId, constraintId, mix (0..1), {frame?, key?} — keyed at the playhead when the mix has keys already (or key: true), else its plain value |
bone.flipBend / bone.moveConstraint / bone.removeConstraints | layerId, constraintId / layerId, constraintId, index / layerId, ids[] |
An instance's bones moved from outside (ONE selected instance of a symbol that has bones; offsets on top of the symbol's own animation — keyed at the playhead inside a motion tween as bone.<id>.<channel> curves, else held on the instance):
| Command | Arguments |
|---|---|
instance.poseBones | {boneId: {rotation?, x?, y?, scaleX?, scaleY?}} — POSED values wanted (the offsets are worked out) |
instance.setBoneOffsets | {boneId: {rotation?, x?, y?, scaleX?, scaleY?, length?}, constraintId: {mix?}} — the offsets themselves |
instance.resetBones | boneIds[]?, {everywhere?} — no offset at this frame (in a motion tween: a key of 0); everywhere = curves / held values removed |
instance.pushBones | — the outer motion becomes the symbol's own bone keys and is cleared outside |
Bones in the Values / Bind system: a bone's property is the channel layer.bone.<boneId>.<x \| y \| rotation \| scaleX \| scaleY \| length> of its bone layer (an IK constraint: layer.bone.<constraintId>.mix) — bind.set({layerId: boneLayerId}, channel, "formula"), values.addRef({layerId: boneLayerId, channel}). In a bone's formula value = what its keys give, this.x / this.y = where the bone is, this.parent = its parent's angle (Follow Pointer = lookAt(pointer) - this.parent).
Weights (a mesh object follows bones: element.skin = {layer, bones, weights}, one row of weights per mesh point, one column per bone). Targets left out = the selected mesh objects; a skin is set on every key of the layer holding that mesh object.
| Command | Arguments |
|---|---|
skin.autoBind | {targets?: [layerId, meshId][], boneLayerId?, boneIds?} — weights from each point's distance to the bones at rest; bones nothing really follows are left out |
skin.bind | the same, to the PICKED bones only |
skin.unbind / skin.copyWeights | targets? — remove the skin / take the weights of the bound mesh object on the keyframe before (by place) |
skin.setSkins | {layerId: {meshId: skin | null}}, {maxBones?} — whole skins (what a Weight Brush stroke ends with) |
skin.setPointWeights | layerId, meshId, points[], boneId, weight (0..1) — the other bones of each point share what is left |
Sound
Sounds live on sound layers (layer.add "sound"); each stores only its start frame (or the keyframe it is bound to). Audio assets are imported with file.importToLibrary (the audio Library folder) or file.importImage (Import to Stage: also puts it on a sound layer at the playhead).
| Command | Arguments |
|---|---|
sound.add | assetId, { layerId?, start? } — on that / the active sound layer, else a new sound layer above the active layer; start = playhead by default |
sound.select | layerId, clipId | null — Properties → Sound edits the selected one |
sound.update | patch (selected sound) or layerId, clipId, patch: { assetId?, start?, trimStart?, trimEnd?, volume? (0..1), loops? (0 = forever), sync? "event" | "stream", effect? "none" | "fadeIn" | "fadeOut" | "fadeInOut" | "left" | "right" | "leftToRight" | "rightToLeft", fade? (s), group? "effects" | "music" (music = one at a time in players) }; null = back to default; a new start unbinds |
sound.move | layerId, clipId, start — re-binds when its keyframe's layer has another key there |
sound.bind | targetLayerId (selected sound, at its start) or layerId, clipId, targetLayerId, frame? — follow that keyframe |
sound.unbind / sound.remove | layerId?, clipId? (default: the selected sound) |
sound.preview | assetId, options? / layerId, clipId / none (selected) — play / stop toggle |
sound.play | idOrName, options? — for scripts: any library sound by id or name, { volume, loops, trimStart, trimEnd, effect, fade, offset } |
sound.stopAll | — |
media.crop | sourceId, from, to, { id?, name?, speed? } — a cropped sound / video (seconds of the source; the original does not change) |
media.setCrop | assetId, { start, end, speed? } — seconds of the ORIGINAL |
media.autoCrop | assetId, { id?, threshold?, pad? } — a raw sound → a new cut without silent head / tail; a cut → narrowed |
media.splitParts | assetId, spans?, { by? "silence" | "transcript", minSilence?, threshold?, pad? } — one cut per part |
sound.split | layerId, clipId, spans?, opts? — the timeline sound becomes one sound per part |
media.clone | assetId, { id? } |
media.editAudio | assetId, edit, { clone?, id? } — clone = the edit lands on a new copy |
media.export | assetId — download the file: a raw one as it is, a cropped one cut now (sound → WAV, video → its container) |
media.applyCrop | assetId — a cut sound replaces its original (audio only) |
media.transcribe | assetId — Gemini speech to text (key from AI settings) |
library.renameAsset | assetId, name |
library.setAssetFolder | assetId | assetId[], folder | null — a sub-folder inside the asset's system folder |
library.renameAssetFolder | type ("audio" | "bitmap" | "footage"), from, to |
library.deleteAsset | assetId — a sound goes with its timeline uses; an image / video only when unused |
AI generation
Pictures / clips made by an outside server (the AI Gen panel; servers in Preferences → AI Generation — the command fails with the reason when none is set up). The request runs in the background: a grey placeholder picture goes on the canvas at once and the result replaces it when the server is done (minutes for a clip), so do not wait for it or render to check it.
| Command | Arguments |
|---|---|
aiGen.generate | { task: "image" | "video" | "sprite" | "pixel", prompt, width?, height?, frames? (video), audio? (video), thenSprite? (cut the background off afterwards), thenPixel?, place? (false = Library only), defaults? (false = send the prompt as written; true (default) adds the server's default prompt — one subject on a plain green background, for cut-outs; use false for scenery / backgrounds), preset? (image: "prop" (default, the server's prompt) | "character" (full body, front view, on green) | "parts" (cuts the character of reference @1 into separate parts on green, for mesh / bones; prompt may be empty) | "bg" (scenery, no green screen)), input? (sprite / pixel: the reference number to work on) } — fields left out keep the panel's values. The prompt may name the panel's references as @1, @2 … |
aiGen.addSelection / aiGen.addFrames | — the selected objects / the selected frames (else the active layer's frame) become a numbered reference (data = its number) |
aiGen.addLibraryItem | symbolId | assetId — a Library symbol / picture / video as a reference |
aiGen.cancel | jobId |
Document, view, files
| Command | Arguments |
|---|---|
document.setSettings | { width?, height?, fps?, backgroundColor?, responsive?, publishScale?, publishAlign?, publishType?, publishVectors?, publishCompression?, smoothPlayback? } — backgroundColor "#rrggbb" (or the stored "rrggbbaa"); smoothPlayback: true = 強制平滑 (playback draws tween in-betweens at the screen's rate; getState().subframe = how far past the real frame, 0 = a real frame); responsive: true = no stage size (the published page fills the window at 100%); for a fixed stage publishScale "fit"/"none" and publishAlign "center"/"topLeft" place it in the published page |
doc.rename | name |
view.setZoom / view.zoomFit / view.zoomReset / view.toggleOnionSkin / view.toggleGrid | — |
view.togglePerfOverlay | — View › Performance: the canvas corner box (FPS, draw calls, textures / RT, texture memory; DOM .hm-perf-stats); persisted config perfOverlay |
view.setDisplayMode | "normal" / "crisp" (no smoothing, no antialiasing) / "outline" (outlines + picture boxes, no bitmap painting) / "pixel" (pixel art: device-pixel zooms, pixel grid from 500%) / "classic" (CPU vector drawing, 4×4 samples per pixel, curves cut for the zoom) — editor display only. Exports: exportImage.run patch { vector: "normal" | "high" | "16x16" } |
panel.show / panel.toggle | panelId — e.g. "filters", "tween-editor", "properties" |
file.new / file.save / file.export | file.new(name?) = a new document (its name = the folder project index <name>.xh5); save/export open browser pickers; file.export(symbolId) opens the Export dialog for that Library symbol only; file.exportImage(symbolId?) the Export Image dialog (a symbol: its first frame) |
file.exportLottie / exportLottie.run | file.exportLottie(symbolId?) opens File › Export › Lottie… (lists what is baked / not exported); exportLottie.run({symbolId?, name?, resolution?}) downloads <name>.json (Lottie / Bodymovin; symbolId "" = main timeline, resolution = pixels per unit of embedded pictures, default 2). Importing: file.importFiles with a Lottie .json (main comp placed / symbols in the Library) |
selection.exportSvg / selection.copySvg / selection.saveSvg | copySvg(patch?), saveSvg(name?, patch?); patch { precision?, padding? } — the selected objects as one SVG (canvas right-click › Export SVG… opens the dialog). Pasting SVG markup text (clipboard.paste) places it like a dropped .svg |
file.importImage / file.importToLibrary | — (file picker): Import to Stage (image, video, GIF, sound) / Import to Library (several files; each lands in the audio / images / video folder) |
file.importFiles | files [{name, type, content: ArrayBuffer, path?}], at?: {x, y}, {flash?, layerId?, frame?, psd?}? — files dropped from other apps (one on the canvas = Import to Stage at at). A .psd named like an imported PSD symbol asks "Update existing / Import as new" (psd: "update" | "new" = the answer; no dialog on the page = new) |
library.updateFromPsd | symbolId, file?: {name, content} — Update from PSD (gap #18): the imported PSD symbol read again from a new version (no file: the desktop path it came from, else a file dialog). Pixels swapped by layer path / name, bones / weights / meshes / keys kept, new layers added, gone ones kept; one undo step; the report goes to the Output panel |
publish.preview | Ctrl+Enter: plays the document in a new browser tab (pixi.js from the CDN + pixi-hm05; nothing written). Scripts run there; a file whose scripts were not written / imported in this session asks first |
preview.pause / preview.resume / preview.togglePause | — Preview Inspector: freezes / unfreezes the running Publish Preview (every clip, script tweens, sounds); fails when no preview answers |
preview.step | frames = 1 — the preview that many frames on (pauses first) |
preview.hitBoxes | on? (no argument = toggle) — the preview draws every marker on stage over the picture |
preview.drawOutside | on? (no argument = toggle) — the in-editor preview draws the art outside the stage rectangle (at a fixed zoom the page then fills the panel at that scale) |
window.hm05.inspectPreview(msg?) | (not a command) → {paused, hitBoxes, clips: [{id, name, symbol, scene?, section?, frame, last, playing, synced?, hidden?, inputs?, children}]} of the running preview (frames as each timeline counts them); null = none answering. msg = an inspector message (pixi-hm05 InspectMessage): {op: "children", ids} → .nodes (display objects under each id, 0 = stage), {op: "props", id} → .props (x, y, scale, rotation, skew, pivot, alpha, visible, tint, bounds, frame / playing for clips), {op: "pick", x, y} → .picked (ids down to the object at a page point) |
preview.inspectElements / pickElements | on? — the in-editor Preview panel's Inspect pane / pick mode (the next click on the picture selects the object under it) |
preview.selectElement / expandElement | id | null / id, open? — the Inspect pane's tree |
preview.pickElement | x, y — selects the object drawn at that page point (CSS px), opens its rows |
preview.setElementProp | id, prop, value — live on the page (no history): x / y / scaleX / scaleY / rotation / skewX / skewY (degrees) / pivotX / pivotY / alpha / visible / tint ("rrggbb") / frame / playing; a timeline driving the object sets it again at its next key |
publish.previewAt | width, height or "390x844" — the preview in a window whose PAGE is that size (web: a pop-up; desktop: the preview window's content size). File › Preview at Size lists PREVIEW_SIZES (phones, tablet, wide, GDN slots) |
script.new | {name?, folder?, javascript?} — a new player script (TypeScript by default, every lifecycle method empty) in the Library's scripts folder, opened in a code tab |
script.open / script.closeTab / script.showCanvas | assetId, line? / assetId? / — — the code tabs over the canvas |
script.setText | assetId, text — a script's code (no undo step; marks the file unsaved) |
script.addFunction | assetId, name, params? ([{name, type}]) — an empty method in the script's class; its tab opens with the cursor in it |
script.bind | owner, refs — owner {kind:"symbol", symbolId} / {kind:"scene", sceneId} / {kind:"object", layerId} (a symbol instance's object layer); refs [{script, fields?}] (in order) |
script.delete | assetId — the script and its bindings (call actions naming it stay) |
publish.run | { media?, compression?, type?, scale?, align?, overflow?, autoScale?, entry?, offline?, pending?, fit?, jpeg?, singleFile? } — fit = Picture size scale (each picture at its largest on-screen size × fit, 0 = off), jpeg = opaque pictures as JPG, singleFile = JSON / scripts / CSS inside index.html; type "gdn" = played by hm05-lite (no pixi.js) — Shift+F12. No argument = opens the Publish dialog. With settings (saved in the document): writes index.html + pixi-hm05.js + entry.js (entry "default" | "custom" = the document's entry script) + <file name>.json (+ one <file name>_<symbol>.json per Separate file symbol) + media in atlas/ images/ audio/ … (media "files", needs a web server) or "embedded" = JSON + media inside <file name>.data.js (plays from disk); compression "none" | "low" | "medium" | "high"; offline = pixi.js / pixi-filters next to the page; pending "placeholder" | "pause" = what the player does while auto / lazy art loads. A ZIP download on the web, <project folder>/output/ on the desktop |
publish.customEntry | makes (or opens) the document's custom entry script entry.js in the Library's scripts folder and switches Publish to it |
library.setLoadLevel | ids | id, "first" | "auto" | "lazy" — when a symbol / picture / sound / font / data file loads in the published page (first = before it starts) |
library.setFolderLoadLevel | {kind: "symbols", folder} | {kind: "assets", type, folder}, level — every item inside the Library folder (sub-folders too) |
symbol.setSeparateFile | id, on — publish the symbol as its own JSON (+ its own media) |
symbol.setExportAs | id, "auto" | "bitmap" | "vector" — its shapes as atlas pictures or vector paths (auto = vector when ≤ 50 KB) |
export.run | settings? — Export dialog fields, e.g. { format: "spritesheet", region: "camera", from: 0, to: 23, scale: 0.5 }; symbolId ("" = main timeline), sceneIds ([] = all scenes), playback (default true: run the playback actions — the exported timeline's own stop / loops skipped), layout: "grid" | "packed", columns (grid, 0 = auto); format: "spritesheet" | "sequence" | "video" | "gif" | "runtime" (data + media: JSON + media, no JS) | "loadable" (+ scripts bundle) | "page" (a complete published page, also of a symbolId) | "script"; downloads a ZIP (video / GIF: the file). Desktop with ffmpeg: { format: "video", videoCodec: "hevc" | "prores" | "vp9" | "av1", transparent } saves through ffmpeg (asks where) |
export.addScript | code?, fileName? — adds a user export script (format "script", see Export scripts); no arguments = a .js file picker. A script of the same file name is replaced. Then exportScript.run({ scriptId }) (File › Export › Export with Script…, file.exportScript opens its dialog; an old export.run({ format: "script" }) still works) |
export.addExampleScripts / export.removeScript / export.downloadScriptKit | — / id? (default: the chosen one) / — (zip: type file, README, examples) |
history.undo / history.redo | — |
A loop for an AI agent
getState()→ stage size, layers, frame.- Plan shapes in stage coordinates; send them with
runAll. snapshot({ maxSize: 512, type: "image/jpeg" })→ look at the image.- Fix with
listElements()+selection.set+element.setTransforms/color.setPrimary, orundo(); repeat. - Move on:
timeline.insertKeyframe/timeline.goto, draw the next pose, ortimeline.createTweenbetween keyframes.
From a terminal: the hm05 command (desktop app)
A desktop project folder can be driven from a shell / VS Code task with the npm package hm05 (hm05 CLI; tutorial External player scripts): hm05 preview [--watch], hm05 publish (the document's own publish settings, no dialog), hm05 build (bundle the scripts, errors as scripts/Hero.ts:12:4: error: …), hm05 open, hm05 init. It reads ~/.hm05/bridge.json (written by the desktop app: url, token, appPath) and POSTs /bridge/project {folder, action} to the app's local server, which hands it to the editor (runProjectRequest). Related commands: project.setupExternalScripts, project.setExternalScripts(on?), project.openInVSCode, script.openExternal(assetId, line?), script.relink(assetId, path?), script.setPackages({name: version}).