Skip to content

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>" in execute() 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 from listElements() and pass them to selection.set.
  • Commands return { success: false, error } instead of throwing; read error (e.g. "Nothing selected", "Layer is locked").

Commands by area ​

Arguments are positional (run(key, arg1, arg2…)).

Drawing ​

CommandArgumentsNotes
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.addTextx, y, width, contenttext in the toolbox font/colour
draw.eraserings[]erases the area from loose shapes on the active layer
paint.bucketx, y, cellfills the enclosed area at x,y (cell = grid size in px, 1 is fine) or recolours the fill there
paint.eyedropperx, 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.setSecondarycolour | "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.applytype, 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.setselectionKey, gradientreplace one selected shape's gradient (x3,y3 = second axis end: ellipse / skew)
bitmapFill.applyassetId?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.setselectionKey, bitmapFillreplace 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.activatetoolKeyselection, brush, eraser, rectangle, ellipse, line, bucket, text, … (only affects the mouse)

Selection and transforms ​

CommandArguments
selection.setkeys[] ("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.magicWandx, 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.sameColorx, 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.nudgedx, dy (moves the selection)
element.setTransforms{ key: [a,b,c,d,tx,ty] }, label?
element.updatekeys[], 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.setSpriteSheetassetId, { cellWidth, cellHeight, count? } | null — cut an image into equal cells (row by row); null = a plain image
library.placeBitmapassetId, 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.setFrameframe (0-based, wraps) — the cell the selected sprite objects show
sprite.setBoxwidth?, height? — the selected sprite objects' box crops / extends (the texture stays put)
library.colorToTransparentassetId, { 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.spriteSheetToSymbolassetId, 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.offsetdx, 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.editPointslayerId, { 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.nudgedx, 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.matchSizesee 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.

CommandArguments
timeline.gotoframe (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.selectTimefrom, 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 / removeTweeneasing? — a classic tween on a layer holding one object (≤ 1 per key) makes it that object's object layer
timeline.setEasinglayerId, 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.setChannelEasinglayerId, frame, channels[], easing | null — channels x y rotation scaleX scaleY alpha
timeline.setPropertyEasinglayerId, 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.setTracklayerId, 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.setTrackslayerId, frame, [{elementId, channel, keys | null}] — several curves, one undo step
curve.movePathKeylayerId, 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.movePathHandlelayerId, 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.setPathKindlayerId, 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.addPathKeylayerId, frame, elementId, p — x and y keys at p without changing the path (refused when both have one there)
curve.removePathKeylayerId, frame, elementId, p — the x / y keys at p removed (other channels kept)
timeline.moveTweenPathKeylayerId, 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.keyTweenFramelayerId, frame — a frame inside a classic tween becomes a keyframe showing what it showed (double-click on its motion path)
curve.setLoopframe? — 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.clearLoopremoves their loop frames
mesh.convertEachlayout? — one mesh object per selected object (loose shapes together)
curve.keyFramelayerId, frame, [[elementId, channels?], …] — keys at frame holding the values shown (no channels = every curve the object has)
curve.setRemaplayerId, 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.removeHintlayerId, keyIndex, hintIndex, x?, y?
timeline.setLabellayerId, frame, label | null (unique per section)
timeline.setSectionlayerId, frame, name | null — names the section a key of the section layer (layer.add "section", one per timeline) starts; unique per timeline
state.addTransitionfrom | 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.moveTransitionindex, transition / indices[] / from, to — by index in the section layer's transitions (= priority)
section.sharesection, 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.moveKeyframelayerId, from, to
timeline.setKeyframeLengthlayerId, frame, length
timeline.selectLayerlayerId, 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.toggleon? — the camera on / off (one per scene of the main timeline; the first time it frames the stage exactly)
camera.setFrameSizewidth, 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.resetdx, dy / — (a key here framing the whole stage)
layer.toggleMask / layer.toggleMaskedlayerId? — 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.setMaskOptionslayerId?, {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.convertToBitmaplayerId? — every keyframe's art painted into a stage-sized picture
layer.convertToVectorlayerId?, 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.convertToObjectlayerId?, 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.convertToFreelayerId?, 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.toOwnLayertargets?, 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.setParentlayerId?, 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.setParentLooklayerId?, on — the parented layer also takes the parent's alpha / Visible
layer.followFromlayerId?, 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.setPropssee listCommands()
layer.setPropslayerId, { 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.setStageAnchorlayerIds? (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.setFrameActionslayerId, 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.setActionstrigger, 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.setNamename, 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.setStopAtEndsymbolId | 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.setIndependentClocksymbolId | 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.

CommandArgumentsNotes
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.removeTracklayerId?add / remove the layer tween row (removing keeps the look at the playhead)
layerTrack.selectlayerId, frame?focus the row: F6 / Shift+F6 / Create / Remove Tween then work on it
layerTrack.insertKey / layerTrack.removeKeylayerId?, frame?
layerTrack.moveKeylayerId, from, to
layerTrack.createTween / layerTrack.removeTween—on the focused row at the playhead
layerTrack.setEasing / .setChannelEasing / .setPropertyEasinglike timeline.set…Easing with the key's frameblend and visibility always switch at the next key
canned.addkind, { 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.updatelayerId, id, { kind?, start?, length?, params?, easing? | null }params merge (e.g. { direction: "top", distance: 300, bounce: 0.6 })
canned.remove / canned.selectlayerId?, id?
canned.bind / canned.unbindlayerId, 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.setAnimationkind | 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.

CommandArguments
bitmap.selectAll / bitmap.invertSelection— pixel selection
bitmap.nudgePixelsdx, 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.setSubLayerPropssee listCommands()
bitmap.setSubLayerTransformmatrix | 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.placePicturepictureId | {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.unlinkSubLayersubId? — 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.setLimiton? — the canvas limit as it is (off = pictures grow with what is painted)
picture.rename / picture.delete / picture.deleteUnusedpictureId, 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).

CommandArguments
element.set3dpatch | 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.setInnerPerspectivefov | 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.setPerspectivesymbolId, {fov, center?} | null — the perspective of the 3D inside a symbol
filter.addtype, 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.setindex, params — changed parameters only (clamped to their ranges)
filter.remove / filter.setEnabled / filter.moveindex / index, on / index, to
filter.setAll[{ type, params, enabled? }, …] — replaces the list
filter.setAllEnabledon (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 ​

CommandArguments
symbol.convertname? — 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.removeCircleprofileId, {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.registerprofileId, 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.removeItemsprofileId, 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.addMeshItemprofileId, {at, circle?, name?, itemId?} — a blank item: a mesh object over a new symbol with a blue 128 square
slots.switchlayerId, 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.overrideprofileId, 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.unlinklayerId, elementId, profileId (see the item through another profile of the family) / — (the selected objects become ordinary objects)
slots.setRuleslayerId, 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.newname?
symbol.edit / symbol.exitEditsymbolId / levels?
symbol.openTab / symbol.switchTabsymbolId / 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.closeAllTabssymbolId? (default: the active tab) / — — closing the active tab shows the one before it; close all = only the main timeline
library.setDetailsids, {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.placeInstancesymbolId, 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.duplicateid, …

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.

CommandArguments
values.addInputtype = "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.addFormulatext, {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.updateid, {name?, folder?, type?, default?, min?, max?, step?, options?, expr?, channel?}, owner? (null removes an optional field)
values.remove / values.duplicateids[], owner?
values.moveids[], index, owner?, folder?
values.try / values.resetTryid, value, owner? / ids[]? — a trial value of an Input (never saved; colour = "rrggbbaa", point = {x, y})
values.setDefaultids[]?, owner? — the tried values become the saved defaults
values.combinea, 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.setInputlayerId, 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.

CommandArguments
bind.copyTransformlayerId, 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.releaselayerId, channel — unbind and keep what the formula gives now
bind.toValueslayerId, 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).

CommandArguments
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.selectlayerId | null, ids[], mode = "set" | "toggle", {keepObjects?} — keepObjects: the selected objects stay selected (a mesh object + the bone to paint)
bone.poselayerId?, {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.removeKeyslayerId?, ids[]? / layerId?, frame?, ids[]? — the picked bones at the playhead
bone.moveKeyslayerId, from, to, {copy?, boneIds?}
bone.setTrack / bone.setTrackslayerId, 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.deletelayerId, boneId, name / layerId, boneId, parentId | null / layerId, ids[], {inheritRotation?, inheritScale?, color?, limit?} / layerId?, ids[]?
layer.setParentBonelayerId?, 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.setExpandedlayerId, expanded? — the timeline shows a row per bone (left out = toggle; not an undo step)
bone.setRootMotionlayerId, {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):

CommandArguments
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.pinHerelayerId?, boneId? — a target bone (a root) at the bone's tip + the IK constraint, one undo step; the target is picked
bone.updateConstraintlayerId, constraintId, {name?, target?, count?, bend? (1 | -1), mix?, stretch?}
bone.setConstraintMixlayerId, 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.removeConstraintslayerId, 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):

CommandArguments
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.resetBonesboneIds[]?, {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.

CommandArguments
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.bindthe same, to the PICKED bones only
skin.unbind / skin.copyWeightstargets? — 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.setPointWeightslayerId, 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).

CommandArguments
sound.addassetId, { layerId?, start? } — on that / the active sound layer, else a new sound layer above the active layer; start = playhead by default
sound.selectlayerId, clipId | null — Properties → Sound edits the selected one
sound.updatepatch (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.movelayerId, clipId, start — re-binds when its keyframe's layer has another key there
sound.bindtargetLayerId (selected sound, at its start) or layerId, clipId, targetLayerId, frame? — follow that keyframe
sound.unbind / sound.removelayerId?, clipId? (default: the selected sound)
sound.previewassetId, options? / layerId, clipId / none (selected) — play / stop toggle
sound.playidOrName, options? — for scripts: any library sound by id or name, { volume, loops, trimStart, trimEnd, effect, fade, offset }
sound.stopAll—
media.cropsourceId, from, to, { id?, name?, speed? } — a cropped sound / video (seconds of the source; the original does not change)
media.setCropassetId, { start, end, speed? } — seconds of the ORIGINAL
media.autoCropassetId, { id?, threshold?, pad? } — a raw sound → a new cut without silent head / tail; a cut → narrowed
media.splitPartsassetId, spans?, { by? "silence" | "transcript", minSilence?, threshold?, pad? } — one cut per part
sound.splitlayerId, clipId, spans?, opts? — the timeline sound becomes one sound per part
media.cloneassetId, { id? }
media.editAudioassetId, edit, { clone?, id? } — clone = the edit lands on a new copy
media.exportassetId — download the file: a raw one as it is, a cropped one cut now (sound → WAV, video → its container)
media.applyCropassetId — a cut sound replaces its original (audio only)
media.transcribeassetId — Gemini speech to text (key from AI settings)
library.renameAssetassetId, name
library.setAssetFolderassetId | assetId[], folder | null — a sub-folder inside the asset's system folder
library.renameAssetFoldertype ("audio" | "bitmap" | "footage"), from, to
library.deleteAssetassetId — 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.

CommandArguments
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.addLibraryItemsymbolId | assetId — a Library symbol / picture / video as a reference
aiGen.canceljobId

Document, view, files ​

CommandArguments
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.renamename
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.togglepanelId — e.g. "filters", "tween-editor", "properties"
file.new / file.save / file.exportfile.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.runfile.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.saveSvgcopySvg(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.importFilesfiles [{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.updateFromPsdsymbolId, 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.previewCtrl+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.stepframes = 1 — the preview that many frames on (pauses first)
preview.hitBoxeson? (no argument = toggle) — the preview draws every marker on stage over the picture
preview.drawOutsideon? (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 / pickElementson? — the in-editor Preview panel's Inspect pane / pick mode (the next click on the picture selects the object under it)
preview.selectElement / expandElementid | null / id, open? — the Inspect pane's tree
preview.pickElementx, y — selects the object drawn at that page point (CSS px), opens its rows
preview.setElementPropid, 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.previewAtwidth, 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.showCanvasassetId, line? / assetId? / — — the code tabs over the canvas
script.setTextassetId, text — a script's code (no undo step; marks the file unsaved)
script.addFunctionassetId, name, params? ([{name, type}]) — an empty method in the script's class; its tab opens with the cursor in it
script.bindowner, refs — owner {kind:"symbol", symbolId} / {kind:"scene", sceneId} / {kind:"object", layerId} (a symbol instance's object layer); refs [{script, fields?}] (in order)
script.deleteassetId — 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.customEntrymakes (or opens) the document's custom entry script entry.js in the Library's scripts folder and switches Publish to it
library.setLoadLevelids | 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.setSeparateFileid, on — publish the symbol as its own JSON (+ its own media)
symbol.setExportAsid, "auto" | "bitmap" | "vector" — its shapes as atlas pictures or vector paths (auto = vector when ≤ 50 KB)
export.runsettings? — 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.addScriptcode?, 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 ​

  1. getState() → stage size, layers, frame.
  2. Plan shapes in stage coordinates; send them with runAll.
  3. snapshot({ maxSize: 512, type: "image/jpeg" }) → look at the image.
  4. Fix with listElements() + selection.set + element.setTransforms / color.setPrimary, or undo(); repeat.
  5. Move on: timeline.insertKeyframe / timeline.goto, draw the next pose, or timeline.createTween between 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}).

HereSplash — 2D animation for the web