MCP: animation, textures and tiles areas (#429)

Area table, notes on animations, tilemaps and nine slice, tests.
admin committed 2026-10-18 16:24:33 +02:00
1 parent 55a0ab0473
commit 180cc43a15
1 file changed
+24 -5
+24 -5
@@ -58,7 +58,7 @@ the badge says *Agent offline* meanwhile.
| `get_view` | What you are looking at: the project, the tab and the document it shows, the selection with names (objects, nodes by type, frames, keys ...), the camera of the view, whether the game is playing or paused, tabs in windows of their own, and the menu or dialog on top (a menu by its first entries) |
| `screenshot` | The whole editor as drawn, as a PNG, at most `maxWidth` pixels wide (1280 unless asked otherwise) |
| `list_assets` | The project's settings (start scene, layers, play settings, master bus) and the assets with ids, names and types, by type or a part of the name |
| `get_asset` | One asset as stored, with the rows of its properties and the named objects of a scene or container, the content of a placed container too (marked `fromContainer`, ids like `<container object>~<path>`). A graph is only counted, pixels and map cells too |
| `get_asset` | One asset as stored, with the rows of its properties and the named objects of a scene or container, the content of a placed container too (marked `fromContainer`, ids like `<container object>~<path>`). A graph is only counted, and so are the pixels of a drawing and the cells of a map past 400. An animation lists what its rows may aim at (`targets`, the root as `""`), with the properties each offers |
| `get_graph` | A graph: every node with its settings and its ports as they are now (the ports it declares itself under `ports`), the edges, the groups and comments with their boxes and colors |
| `lint_graph` | How a graph reads, counted as you see it: nodes on top of each other, links that cross, links running over a node that is not theirs, links running right to left, the longest links, with a few ids of each |
| `catalog` | What there is to make: the commands by area with what each does, and with a query (an area or command names) their arguments; the nodes a graph can hold (all of them, or the best matches of a search in full); the asset types and their properties; the variable kinds |
@@ -112,7 +112,8 @@ it. One Ctrl+Z takes the whole call back.
answer, up to 110 seconds; Cancel, Escape or no answer leave everything as it was.
- **You see what the agent works on.** After each call the editor brings up what its last step
worked on: the graph's tab with every node the call touched there selected, the scene or
container with its objects selected, or the asset in the inspector. Objects in another scene
container with its objects selected, the tab of an animation, curve, texture, tile or tilemap
(with the frame picked when the call worked on one), or the asset in the inspector. Objects in another scene
switch the scene, inside the agent's undo step, so Ctrl+Z goes back to the scene you had.
Account menu → *Follow agent* switches this off (kept in this browser); while the game runs the
editor never follows. `open` and `select` stay for anything else the agent wants to show.
@@ -131,11 +132,22 @@ for an area or for command names asked for.
| variables | `add_variable`, `remove_variable`, `rename_variable`, `move_variable`, `set_variable_kept`, `set_variable_private`, `add_struct_field`, `remove_struct_field`, `rename_struct_field`, `move_struct_field`, `set_struct_type`, `make_struct_type`, `set_list_item_type`, `make_list_item_type` |
| objects | `place_asset`, `remove_objects`, `move_object`, `reorder_object`, `set_editor_offset`, `rename_object`, `set_override`, `clear_override`, `apply_override_to_asset`, `apply_override_to_container`, `revert_override_to_container`, `apply_position_to_container`, `revert_position_to_container`, `set_parent`, `group_objects`, `set_object_group`, `rename_object_group`, `ungroup_objects`, `create_container`, `unpack_container`, `add_collider`, `add_rigidbody`, `add_joint`, `fit_collider` |
| graphs | `add_node`, `arrange_graph`, `remove_node`, `move_node`, `set_node_param`, `collapse_nodes`, `resize_node`, `connect`, `disconnect`, `fold_edge`, `name_transition`, `add_group`, `add_comment`, `fit_group`, `edit_annotation`, `remove_annotation`, `add_port`, `repoint_port`, `remove_port`, `rename_port`, `move_port`, `set_port_write`, `set_port_machine`, `set_port_default`, `set_node_struct_type`, `split_output`, `set_list_node_type` |
| animation | `set_animation_root`, `add_animation_track`, `remove_animation_tracks`, `retarget_animation_track`, `set_track_relative`, `set_animation_key`, `set_key_easing`, `remove_animation_keys`, `move_animation_keys`, `shift_animation_frames`, `key_straight_run`, `set_curve_points` |
| textures | `add_frame`, `set_frame_rect`, `rename_frame`, `remove_frame`, `slice_frames`, `set_nine_slice`, `set_sort_line`, `set_frame_collision` |
| tiles | `add_tile_picture`, `remove_tile_picture`, `move_tile_picture`, `paint_tiles`, `add_tilemap_layer`, `duplicate_tilemap_layer`, `remove_tilemap_layer`, `move_tilemap_layer`, `set_tilemap_layer`, `resize_placed_tilemap` |
| project | `rename_project`, `set_layer_names`, `set_play_from`, `set_while_playing`, `set_game_link_zoom`, `set_symbol_scale`, `set_master_volume`, `set_master_fx` |
A change to the fields of a Struct asset reaches every variable and node of that type, as it does
from the inspector. Animation, sprite frames, tilemaps, pixel art, vector art, songs and
compositions come next (#429, stage 5).
from the inspector. Pixel art, vector art, songs and compositions come next (#429, stage 5).
- **Animations** name a row by its target and property, as `get_asset` lists them, and a key by
its row and frame. An easing is a name like `sine-out` or `curve:<id>` for a Curve asset; how
long an animation runs, its fps and playback, are properties as in the inspector.
- **Painting a tilemap** takes rectangles and single cells in one step; the rectangles go first, so
a cell can cut a hole into one. A cell outside the grid is refused, the grid being the largest
the tilemap has, its own or that of a placement grown at an edge. At most 20 000 cells a step.
- **A nine-slice** without `fill` keeps the fill the picture has. *Generate collision* stays with
you: it reads the pixels of the texture, so the agent sets outlines by their corners.
Not for the agent, on purpose: textures, fonts, sounds and videos need a file, pasting needs the
clipboard (the agent builds directly instead), and switching a plugin on would run its code.
@@ -213,6 +225,12 @@ What is behind it on the server, and the routes it uses: [API](API), [Developmen
it (and refusing a name it does not know), a group and a comment fitted to the nodes after the
call arranged them, a field of a Struct asset reaching the variables of that type, a container's
content listed by the ids an override takes, object groups, and the project settings.
- `tests/editor/agent-art.test.ts`: an animation keyed with easing in one call and shown in its
tab, the targets of a scene root, an easing there is none of, keys moved and copied, frames
inserted; a curve held from x 0 to x 1; a frame handed on, nine-sliced (and its fill kept) and
picked in its tab, a sheet sliced into a grid; a tilemap painted with rectangles and cells and
read back, cells outside the grid, tiles that are none and too many cells refused, the grid of a
placement grown at its edge, layers added, changed and moved.
- `tests/editor/graph-arrange.test.ts`: the layout on the graph an agent really built for "walk with
the arrow keys" (no overlaps, no link over a node, none backwards, at most 8 crossings with one
Owner for four moves and 4 with one each), chains running straight, the flow on top when two
@@ -228,6 +246,7 @@ What is behind it on the server, and the routes it uses: [API](API), [Developmen
account menu, an MCP client reading the view, hearing a tab switch and taking a screenshot; the
agent building a walking object whose graph comes up with its nodes selected and arranged,
Arrange in the header untangling it as one undo step, the open tab's camera going after a node
added far away, a Variables node with a port and a group framing every drawn node, the object moving when played, the agent holding the arrow and clicking the
added far away, a Variables node with a port and a group framing every drawn node, an animation keyed by
the agent coming up in its tab, the object moving when played, the agent holding the arrow and clicking the
object itself and reading with `get_runtime` how far it went, one Ctrl+Z taking it back, a delete waiting for
the user's Cancel; and the badge switching it off.