Edit shot layers and keyframes
Use these operations for artwork inside a shot animation. They use shot-local frames; storyboard layer handles use board frames.
To insert a complete character into an existing shot, use character instances. This preserves the destination set and camera while copying the character's editable rig and local performance.
Edit local animation channels
project.editShotAnimation(animationId, edits) applies a validated batch through the existing project transaction. reviseShotAnimation(animation, edits) applies the same algorithm to isolated values and returns a new animation. A batch contains 1–1000 operations:
layer.set:layerIdandchangesusingLayerChanges. A null mask removes the mask binding; nested transforms are complete replacements.layer.exposure:layerIdand an exclusive-end localexposureinterval, or null to remove the interval.layer.drawings: grouplayerIdand local drawing-sequencekeys, or null to remove substitution selection. An empty sequence produces blank exposures.layer.key.put:layerIdand completeLayerKeyframeinkey;layer.key.remove:layerIdand keyid.camera.key.put: completeCameraKeyframeinkey;camera.key.remove: keyid.
project.editShotAnimation('animation:greeting', [{
op: 'camera.key.put',
key: { id: 'camera:greeting-push', frame: 24, zoom: 1.2, easing: 'ease-in-out' },
}]);Put operations insert or replace by stable ID, not by frame. Provide all intended keyed channels; omitting an old channel removes it from that key. Keys are sorted by frame and duplicate frame positions reject at final validation. A batch can swap two key positions without an intermediate collision failure. Signed safe-integer local frame positions support preroll. Empty-property keys, incompatible depth/rig edits, missing targets, invalid masks/drawing dependencies and duplicate identities reject. The project additionally enforces global IDs, foreign layer locks and referenced assets/components. Existing board keyframe methods retain their board-specific behavior. Commands omit unrelated artwork, but the current project transaction may still clone artwork internally; this is not a copy-cost guarantee.
Construct and reorganize shot layers
animation.edit/editShotAnimation also accept:
layer.add: explicitid,kind(raster,vector,group),name, optional layeroptions, optional groupparentIdand siblingbeforeId. Creates an empty layer; omitted parent means the root and omitted insertion target appends. Options accept signed local exposure times.layer.move:layerId, explicitparentId(null for root), optionalbeforeId. Reorders/reparents with local transforms unchanged; this does not preserve world-space placement automatically. Parenting under self/descendants rejects. Moving before itself within the same parent is a no-op.layer.remove:layerId; removes the subtree.layer.rig: grouplayerIdand a two-bonedefinition, or null to unbind.layer.depth: rootlayerIdand positivedepth.
Later operations address the hierarchy produced by earlier ones. Final validation rejects dangling masks, drawing selections, invalid rig elbows and nested keyed depth planes; revise dependent bindings in the same batch. Project review anchors and locks are preserved, so removal that would orphan them rejects. Resolve/re-anchor/remove those records explicitly rather than losing them during topology edits. New IDs must be globally unique.
Fill a drawing layer with project.addShotElement(animationId, layerId, element), supplying a complete editable element with a stable ID. removeShotElements(animationId, layerId, ids) removes a nonempty set of unique IDs from that layer. Both reuse project transactions, type compatibility, global identity and reference validation. Plan equivalents are animation.element.add (encode its element using planShotElement) and animation.element.remove. Raster plans retain the 1 MiB total plan budget; the SDK can author larger surfaces directly.
Codeboard by Nonom Friedman
Explore Nonom Library