Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .agents/secret-exceptions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"version": 1,
"exceptions": [
{
"path": "Package.swift",
"type": "Hex High Entropy String",
"fingerprint": "sha1:eb7c49bf27318a1c351a6d03b59b194c80dc68d9",
"reason": "Public Swan Git commit pin 790df787281e9cf1c2358a11bb42b2ec2df01029, already used by Package.swift and Tools/ada-toolchain.json; not a credential"
},
{
"path": "Tools/ada-toolchain.json",
"type": "Hex High Entropy String",
Expand Down
18 changes: 18 additions & 0 deletions Documentation/AnimationGraphs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Skeletal animation graphs

For editable project-owned clips, see [Animation authoring](../Editor/Documentation/AnimationAuthoring.md).
Bound `.animlib` clips use `library.runtimeName(for: clipID)` in existing graph clip nodes.

In Studio, **Animator → Animation Graph** displays pose cards and wires on a canvas.
Drag an output to an input to connect cards, or drag a connected input to move its
connection while retaining its weight and bone mask. The right Inspector edits
the selected card and its input properties. **Fit**, middle-drag/**Pan**, and scroll
control canvas navigation. Node and wire edits support Undo/Redo; cyclic connections
are rejected. The card marked Output identifies the graph root. This visual editor
uses the clip/blend/additive model described here; state machines and blend spaces
remain separate extensions.

The shared agent/Tools contract also exposes `graphInspect`, `graphApply`,
`graphUndo`, `graphRedo`, `graphPreview` and `graphBind` for an open model/library
workspace. Graph revisions are separate from clip-library revisions. See the
[request contract](../Editor/Documentation/AnimationAuthoring.md#agent-request-contract)
for paging, permissions and explicit scene publication.

`AnimationGraph` combines imported GLB/glTF clips into a single local pose. It is
available through `AdaAnimation` and the `AdaEngine` facade. Each
`SkeletalAnimationPlayer` owns its clock, graph buffers and pending events.
Expand Down
707 changes: 707 additions & 0 deletions Documentation/Designs/animation-authoring.md

Large diffs are not rendered by default.

267 changes: 267 additions & 0 deletions Documentation/Designs/animation-ik.md

Large diffs are not rendered by default.

402 changes: 402 additions & 0 deletions Documentation/Plans/2026-11-04-AnimationAuthoring.md

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions Documentation/Plans/2026-11-06-AnimationIK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Native Animation IK Implementation

Date: 2026-11-06. Status: implementation in progress; no milestone is closed by this plan.
Accepted design: [Native Animation IK](../Designs/animation-ik.md), explicitly approved in
the current conversation's response annotation. Preserve all existing animation-authoring
and control-style work. Existing validation blockers remain open rather than becoming passes.

## Delivery sequence

1. **Pose boundary and numerical solvers.** Add validated, Sendable/Codable configuration
and compiled instance-local modifier buffers in `AdaAnimation`. Separate evaluated base,
visual base and final corrected transforms in the existing player. Implement stateless
two-bone and bounded FABRIK, deterministic degenerate/collinear seeding, measured reach
error, influence and ordered composition. Keep imported quaternion interpolation unchanged.
Cover 3D and planar math; planar math alone does not establish native 2D authoring/rendering.
2. **Runtime/resource integration.** Add the versioned `.animmod` resource and backward-
compatible `Model3DSource` reference/scene overrides. Resolve every model owner, ordinary
marker and pole from one current local-transform hierarchy snapshot before any stack.
Declare ECS read/write access and ordering, including voxel transform writers. Reject
targets under any animated rig and duplicate scene identities. Preserve live valid models
on invalid replacement; keep strong resource handles and remap/re-resolve scene bindings
when instancing/navigating. Finalize once after LOD and publish identical node/skin poses.
3. **Shared authoring service and clients.** Implement atomic modifier edits, explicit saving,
bounded history, reload/conflict recovery, sample diagnostics and revision-checked binding.
Extend the existing animation request/agent/real Tool VM bridge; preserve permissions,
callback rollback, queue limits and capability discovery. Do not advertise incomplete actions.
4. **Native Studio workflow.** Add the Modifiers section in the resizable Model panel,
contextual Inspector fields and viewport target/pole gizmos, sharing the existing player.
Preserve one-step drag Undo and stable bone IDs. Apply the accepted
[control rules](../../Editor/Documentation/Design/Controls.md), EN/RU localization and
unkeyed-pose recovery. Inspector remains the property owner; Graph remains the base-pose canvas.
5. **Native 2D dependencies and IK adapter.** Implement the accepted M5/M6/M7 spatial-path,
native rig/weighted mesh and spline-chain deliveries as distinct observable slices. Use
the existing native `Mesh2D` render path, without depending on Spine. Adapt the shared
solvers while retaining continuous-turn base angles plus shortest corrective deltas.
Test actual weighted deformation, bounds, scene/resource identity and independent instances.
6. **Animation bindings and complete authoring acceptance.** Connect influence and model-space
target/pole coordinates to M2's typed animation-property work. Deliver advanced temporal
curves, path following and spline deformation through their previously approved plan,
without treating a numerical solver or path follower as the whole requested workflow.

An initial safe default evaluates enabled stateless modifiers on animation-system updates,
including paused clips. LOD may skip base sampling but cannot freeze mutable targets. No
physics/stateful cadence, implicit stretching, general joint limits or full-body IK is introduced.

## Initial ownership and later scope expansion

The runner initially owns the accepted design/approval metadata, this plan,
`Sources/AdaAnimation/Modifiers/AnimationPoseModifier.swift`, `CompiledPoseModifiers.swift`,
`IKMath.swift`, the existing `SkeletalAnimationPlayer.swift`, and
`Tests/AdaAnimationTests/SkeletalIKTests.swift`. Add exact scene, asset, script, Editor and
renderer files before editing each integration slice. Do not sweep unrelated M1 changes into
the new task or alter validation policy to conceal missing platforms/tools.

## Documentation delivered with implementation

Author `Sources/AdaEngine/AdaEngine.docc/Articles/Developers/AnimationIK.md` with executable
Swift examples, spaces/order, defaults, limitations and diagnostics. Link it from DocC Topics
and AnimationAuthoring. Extend `Editor/Documentation/AnimationAuthoring.md`, AnimationGraphs,
the owning asset/agent references, the actual AnimationHelper Tool and offline catalog as their
clients become available. Clearly distinguish mathematical planar support from native 2D mesh
authoring and visible deformation. Do not document unimplemented API as available.

## Validation and completion

### Current 3D slice (2026-11-06)

The 3D base/final pose boundary, two-bone and FABRIK solvers, `.animmod` resource,
scene marker binding, shared agent/Tool requests, Inspector/Model panel and viewport
gizmos are implemented. Focused production-path tests and Windows Studio/Play captures
exercise this slice. Independent interim reviews found numerical near-opposite rotation,
Inspector binding restoration, active-model Undo routing and attached-document lifetime
issues; those have been corrected and covered by regressions. This is progress evidence,
not milestone closure or full accepted-design validation.

Native temporal easing, monotone Bézier sampling, schema-2 persistence and numeric
Inspector handles are implemented as an M2 slice. Native 2D rigs/weighted deformation,
splines, typed animation of modifier properties, Auto Key for those properties,
additional tangent modes/canvas handle dragging and complete platform/render/benchmark
acceptance remain outstanding. Windows DocC conversion currently fails with an invalid
filename; the article's executable Swift example has been compiled/run independently.
Retain these failures and missing platform checks in the contribution report.

- Use Swift Testing through real production evaluators. Each behavior slice records genuine
Red/Green/Refactor. Minimal new API/data scaffolding may be needed to compile a new test;
do not count a missing symbol or compilation failure as behavioral Red.
- For fast core iteration use a task-owned dependent Swift package that compiles the actual
repository `AdaAnimation`/`Math` products and byte-identical owning tests. This is focused
module evidence, not a substitute for full root/Editor/platform validation.
- Exercise reachable/outer-unreachable/inner-gap/zero-direction targets, arbitrary exported
axes, pole degeneracy, preserved lengths/scales, rotated parents, uniform versus unsupported
transforms, influence 0/0.5/1, stack ordering, iteration budgets and deterministic repeated solves.
- Runtime tests compare final nodes and palettes for pause, LOD, seek, crossfade, graph mixing,
duplication and current moving/deleted/rebound targets. Test target restrictions across rigs,
malformed resources, path confinement and atomic failed replacement.
- Run real Studio and Play/Tool acceptance from complete staged distributions on supported
desktop hosts. Capture actual model deformation and native 2D frames; run affected Metal/
WebGPU golden paths. Numerical samples do not prove rendered IK or a native 2D workflow.
- Build DocC, compile/run examples, validate offline guides/localization, run the full applicable
contribution profile and independent `adaengine-review`. Fix findings and repeat affected
checks/review. Missing hardware/tools and failed/timed-out checks remain explicit blockers.
Do not claim M1, IK or the full M2–M7 request complete until their exit evidence exists.
2 changes: 2 additions & 0 deletions Editor/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ before editing. Do not load the whole capability inventory by default.
[visual design rules](../AGENTS.md#ada-studio-visual-design-rules) and use
[adaengine-studio-design](../.agents/skills/adaengine-studio-design/SKILL.md):
present a visual before implementation and inspect the rendered result before completion.
- Native controls follow [the control design rules](Documentation/Design/Controls.md):
visible button surfaces/states, themed fields, inline colored axis badges and overflow indicators.
- Every UI change includes English and Russian text in the same change. Native
UI uses `L10n` and the shared language preference; read the
[localization rules](Documentation/AgentGuides/localization.md) before changing it.
Expand Down
4 changes: 2 additions & 2 deletions Editor/Documentation/Agent3DWorkflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The mobile agent and desktop editor MCP share native model tools and offline kno

Validation checks dependency containment and byte budgets, native decoding, image decoding, scene hierarchy, primitive geometry and the current import profile. `editor.asset.validate` also routes GLB/glTF to this validation. This is not a complete Khronos conformance check, GPU rendering proof or animation-playback proof. It does not author or validate gameplay collision shapes.

This profile supports glTF 2.0 primitive topologies, UV0/UV1, one set of four skin influences and at most 128 joints per skin. Required Draco/Meshopt/KTX2 extensions are unsupported. Node TRS clips can use LINEAR, STEP and CUBICSPLINE interpolation; morph-weight animation is unsupported. Models and their local dependencies have a combined 128 MiB budget. JSON and decoded accessor inventories have additional bounds.
This profile supports glTF 2.0 primitive topologies, UV0/UV1, one set of four skin influences and at most 128 joints per skin. Required Draco/Meshopt/KTX2 extensions are unsupported. Node TRS and morph-weight clips can use LINEAR, STEP and CUBICSPLINE interpolation. Models and their local dependencies have a combined 128 MiB budget. JSON and decoded accessor inventories have additional bounds.

## Import and place

Expand All @@ -32,4 +32,4 @@ Read exact Camera, Mesh3DComponent, light, Environment3D and physics payloads fr

Desktop uses `editor.build.start`, `editor.play.start`, `editor.task.status`, `editor.output.read`, `editor.play.capture` / `render.capture_screenshot` (the running game's camera frame; the editor window is returned only when no game runs, and is not evidence) and `editor.play.run_scenario` for scripted input, frames and state. Mobile uses `editor.build`, `editor.play.start`, `editor.play.capture` and `editor.image.read`. Select the tools actually advertised by the current host. Desktop asset tools exclude mobile vision analysis and direct on-disk scene assignment; desktop scene edits go through the revision/undo workflow. Save dirty asset documents before tool writes.

After validation and build, inspect a completed frame from visible Play. A 3D scene needs a camera, a light and an `Environment3D` (or a camera `backgroundColor`/clear flags) so the frame is not a flat clear color; `editor.play.run_scenario` can capture before/after frames around input. Exercise selected clips and compare frames at different times for animation. Isolated simulation verifies logic and keyboard/physics behavior; it does not install Model3D or prove rendering. Blender execution, rig editing and skeletal clip authoring are not exposed by these Studio tools. To create a new low-poly model use editor.model.generate (an AdaScript program that writes a GLB) or editor.voxel.generate (a .vox).
After validation and build, inspect a completed frame from visible Play. A 3D scene needs a camera, a light and an `Environment3D` (or a camera `backgroundColor`/clear flags) so the frame is not a flat clear color; `editor.play.run_scenario` can capture before/after frames around input. Exercise selected clips and compare frames at different times for animation. Isolated simulation verifies logic and keyboard/physics behavior; it does not install Model3D or prove rendering. Native desktop agents can create/extract and edit skeletal/morph clips using the revision-checked `editor.animation.*` API; read [Animation authoring](AnimationAuthoring.md) for explicit Save, scene binding, shared Tool API 2, budgets and verification. Query `animationAuthoring` in desktop project context before use; mobile hosts do not advertise these desktop authoring commands. Blender execution, visual rig-structure editing and automatic rig inference remain unavailable. To create a new low-poly model use editor.model.generate (an AdaScript program that writes a GLB) or editor.voxel.generate (a .vox).
12 changes: 12 additions & 0 deletions Editor/Documentation/AgentGuides/agent-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,15 @@ Entry points: [GitReviewService.swift](../../Sources/AdaEditor/Tooling/GitReview
Coverage: [GitReviewTests.swift](../../Tests/AdaEditorTests/GitReviewTests.swift),
[EditorAgentCatalogTests.swift](../../Tests/AdaEditorTests/EditorAgentCatalogTests.swift),
[EditorMobileAgentToolTests.swift](../../Tests/AdaEditorTests/EditorMobileAgentToolTests.swift).


### 3D IK authoring

`.animmod` resources use the shared revisioned modifier draft and ordered two-bone/FABRIK
runtime. Model panel selection, Inspector settings and viewport handles use the same edit
commands as `editor.animation.modifier*` and API 2 Tool jobs. Save is explicit; saved resources
bind to compatible `Model3DSource` instances with separate current scene revisions and stable
marker IDs. Marker snapshots use current local transforms, including while paused/under LOD.
The actual `IKHelper` Tool example is in `Documentation/Examples/StudioTools/IKHelper`.
See [Animation authoring](../../Documentation/AnimationAuthoring.md#ik-modifiers).
Native 2D weighted/spline deformation and typed IK timeline bindings remain separate stages.
12 changes: 12 additions & 0 deletions Editor/Documentation/AgentGuides/assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,15 @@ Coverage: [EditorTextureAtlasTests.swift](../../Tests/AdaEditorTests/EditorTextu
import, preview, placement and clip playback exist; visual imported-material
editing, skeleton editing and skeletal-clip authoring remain incomplete.
The shared-workbench model preview has not established iPhone UI parity.


### 3D IK authoring

`.animmod` resources use the shared revisioned modifier draft and ordered two-bone/FABRIK
runtime. Model panel selection, Inspector settings and viewport handles use the same edit
commands as `editor.animation.modifier*` and API 2 Tool jobs. Save is explicit; saved resources
bind to compatible `Model3DSource` instances with separate current scene revisions and stable
marker IDs. Marker snapshots use current local transforms, including while paused/under LOD.
The actual `IKHelper` Tool example is in `Documentation/Examples/StudioTools/IKHelper`.
See [Animation authoring](../../Documentation/AnimationAuthoring.md#ik-modifiers).
Native 2D weighted/spline deformation and typed IK timeline bindings remain separate stages.
Loading
Loading