Files
OrcaSlicer/tools/mcp/tests/ops_export_stl.json
T
SoftFever d64e10f4dd Regroup the slicer's MCP commands and let each run from its arguments
Outside the Design tab an agent had 175 commands, 50 of them in the tool
list. There are now 118, named by what they act on (`object_`, `plate_`,
`preset_`, `filament_`, `plugin_` and so on), and 115 are listed. Each takes
its target and values in the call, acts on the selection when it names no
target and says what it acted on; an old name is refused. Printers and
system filaments install and uninstall, preferences read and write, plugins
enable, reload, uninstall and refresh, and objects reorder, with no dialog
to drive.

The Speed Dial keeps its 129 tiles under the same ids. Eight defects in the
rows these commands share with the menus are fixed. For a person: an object
row that cannot run says why instead of "Select an object first.", rows
that failed no longer claim success, Duplicate Plate can be undone, and
Refresh Plugins picked while a refresh runs now runs after it instead of
beside it.
2026-11-18 16:50:32 +08:00

51 lines
3.2 KiB
JSON

// Records what the STL export, project_export with format stl and a path, does: with no objects and with two,
// each case exported once, to a file named for it. After each it reads whether the file is there (an stl export
// to the same path with a plate the project lacks refuses with "exists" when it is, with the plate when not; for
// the file written with no objects, once the objects are added), the project and the undo snapshots taken since
// the last read (fixtures/ops_undo.py), and last imports each file into an empty project to show what it holds.
// Every call it records is optional. Run it into a fresh --out directory (an export without overwrite refuses the
// file of an earlier run):
// tools/mcp/orca_mcp.py run-replay tools/mcp/tests/ops_export_stl.json --out <new dir>
{
"orca_replay_version": "0.2.0",
"name": "ops export_stl",
"vars": {"undo": "${replay_dir}/fixtures/ops_undo.py"},
"steps": [
{"tool": "app_wait", "args": {"for": "ready"}},
{"tool": "project_new", "args": {"discard_changes": true, "preset_changes": "discard"}},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
// ---- No objects ----
{"tool": "project_export", "args": {"format": "stl", "path": "${out_dir}/empty.stl"}, "optional": true},
{"tool": "app_state"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
// ---- With two objects ----
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 20]}},
{"tool": "object_select", "args": {"none": true}},
{"tool": "object_add_primitive", "args": {"shape": "cylinder", "size": [20, 10]}},
{"tool": "object_arrange", "args": {"plates": "all"}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "project_export", "args": {"format": "stl", "path": "${out_dir}/empty.stl", "plates": 999}, "optional": true},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
{"tool": "project_export", "args": {"format": "stl", "path": "${out_dir}/two_objects.stl"}, "optional": true},
{"tool": "project_export", "args": {"format": "stl", "path": "${out_dir}/two_objects.stl", "plates": 999}, "optional": true},
{"tool": "app_state"},
{"tool": "script_run", "args": {"filename": "${vars.undo}", "code": "import ops_undo\nresult = ops_undo.taken()"}},
// ---- What the files hold ----
{"tool": "project_new", "args": {"discard_changes": true}},
{"tool": "project_import", "args": {"paths": ["${out_dir}/empty.stl"]}, "await": false, "save_as": "import_empty", "optional": true},
{"tool": "app_state"},
{"tool": "dialog_answer", "args": {"button": "ok"}, "optional": true},
{"tool": "dialog_answer", "args": {"button": "ok"}, "optional": true},
{"tool": "app_wait", "args": {"for": "job", "job": "${jobs.import_empty}"}, "optional": true},
{"tool": "project_import", "args": {"paths": ["${out_dir}/two_objects.stl"]}, "optional": true},
{"tool": "object_list"},
{"tool": "project_new", "args": {"discard_changes": true}}
]
}