mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-29 00:21:56 -05:00
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.
111 lines
9.5 KiB
JSON
111 lines
9.5 KiB
JSON
// Assigns filaments to objects and parts through settings_set, as the object list's Change Filament
|
|
// does, and reads them back with settings_get's effective values; then sets the project's slot colours,
|
|
// flushing volumes, plate type and prime tower position with project_set_settings, reading them back with
|
|
// project_get_settings. Run it with
|
|
// tools/mcp/orca_mcp.py run-replay tools/mcp/tests/multicolor.json --out /tmp/multicolor
|
|
{
|
|
"orca_replay_version": "0.2.0",
|
|
"name": "object and part filaments",
|
|
"steps": [
|
|
{"tool": "app_wait", "args": {"for": "ready"}},
|
|
{"tool": "dialog_auto_answer", "args": {"rules": [{"match": "unsaved changes", "button": "no"},
|
|
{"match": "restore", "button": "no"},
|
|
{"match": "Uniform scale", "button": "ok"}]}},
|
|
{"tool": "project_new", "args": {"discard_changes": true}},
|
|
{"tool": "window_set", "args": {"size": [1600, 900]}},
|
|
{"tool": "view_set", "args": {"tab": "prepare"}},
|
|
// A second filament (or one more, on a datadir an earlier run left with several).
|
|
{"tool": "widget_click", "args": {"target": {"label": "Add one filament"}}},
|
|
{"tool": "app_state", "expect": {"/presets/filaments/1": {"exists": true}}},
|
|
|
|
// Object 0 a cube, object 1 a cylinder.
|
|
{"tool": "action_run", "args": {"id": "orca_command:add_primitive_cube:orca"}},
|
|
{"tool": "app_wait", "args": {"for": "idle"}},
|
|
{"tool": "object_select", "args": {"none": true}},
|
|
{"tool": "action_run", "args": {"id": "orca_command:add_primitive_cylinder:orca"}},
|
|
{"tool": "app_wait", "args": {"for": "idle"}},
|
|
{"tool": "object_transform", "args": {"object": 0, "translate": [100, 100, 12.8], "mode": "absolute"}},
|
|
{"tool": "object_transform", "args": {"object": 1, "translate": [160, 100, 12.8], "mode": "absolute"}},
|
|
|
|
// ---- An object's filament, read back, undone and redone ----
|
|
{"tool": "settings_set", "args": {"target": "object", "object": 1, "values": {"extruder": 2}}, "expect": {"/applied/extruder": {"eq": "2"}}},
|
|
{"tool": "settings_get", "args": {"target": "object", "object": 1, "keys": ["extruder"]},
|
|
"expect": {"/items/0/effective": {"eq": "2"}, "/items/0/source": {"eq": "object"}}},
|
|
{"tool": "settings_get", "args": {"target": "object", "object": 0, "keys": ["extruder"]}, "expect": {"/items/0/effective": {"eq": "1"}}},
|
|
{"tool": "action_run", "args": {"id": "orca_command:undo:orca"}},
|
|
{"tool": "settings_get", "args": {"target": "object", "object": 1, "keys": ["extruder"]}, "expect": {"/items/0/effective": {"eq": "1"}}},
|
|
{"tool": "action_run", "args": {"id": "orca_command:redo:orca"}},
|
|
{"tool": "settings_get", "args": {"target": "object", "object": 1, "keys": ["extruder"]}, "expect": {"/items/0/effective": {"eq": "2"}}},
|
|
|
|
// ---- A single-part object's part 0 is the object: its filament is set there ----
|
|
{"tool": "settings_set", "args": {"target": "part", "object": 1, "part": 0, "values": {"extruder": 1}},
|
|
"expect": {"/applied/extruder": {"eq": "1"}, "/note": {"exists": true}}},
|
|
{"tool": "settings_get", "args": {"target": "object", "object": 1, "keys": ["extruder"]}, "expect": {"/items/0/effective": {"eq": "1"}}},
|
|
{"tool": "settings_set", "args": {"target": "object", "object": 1, "values": {"extruder": 2}}},
|
|
|
|
// ---- A text part on the cube takes filament 2; the object's reply lists it apart ----
|
|
{"tool": "object_select", "args": {"objects": [0]}},
|
|
{"tool": "widget_click", "args": {"target": {"gizmo": "Text"}}, "expect": {"/created": {"eq": true}, "/active": {"eq": true}}},
|
|
{"tool": "app_wait", "args": {"for": "idle"}},
|
|
{"tool": "widget_click", "args": {"target": {"imgui": "Done"}}},
|
|
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/1/text": {"exists": true}}},
|
|
{"tool": "settings_set", "args": {"target": "part", "object": 0, "part": 1, "values": {"extruder": 2}}, "expect": {"/applied/extruder": {"eq": "2"}}},
|
|
{"tool": "settings_get", "args": {"target": "part", "object": 0, "part": 1, "keys": ["extruder"]},
|
|
"expect": {"/items/0/effective": {"eq": "2"}, "/items/0/source": {"eq": "part"}, "/note": {"exists": true}}},
|
|
{"tool": "settings_get", "args": {"target": "object", "object": 0, "keys": ["extruder"]},
|
|
"expect": {"/items/0/effective": {"eq": "1"}, "/items/0/parts/0/part": {"eq": 1}, "/items/0/parts/0/value": {"eq": "2"}, "/note": {"exists": true}}},
|
|
// Default on a part is its object's filament.
|
|
{"tool": "settings_set", "args": {"target": "part", "object": 0, "part": 1, "values": {"extruder": null}}, "expect": {"/applied/extruder": {"eq": "1"}}},
|
|
{"tool": "settings_set", "args": {"target": "part", "object": 0, "part": 1, "values": {"extruder": 2}}},
|
|
|
|
// ---- A filament and another setting in one call are one undo step; the object's filament clears the part's ----
|
|
{"tool": "settings_set", "args": {"target": "object", "object": 0, "values": {"extruder": 2, "wall_loops": 5}},
|
|
"expect": {"/applied/extruder": {"eq": "2"}, "/applied/wall_loops": {"eq": "5"}}},
|
|
{"tool": "settings_get", "args": {"target": "object", "object": 0, "keys": ["extruder", "wall_loops"]},
|
|
"expect": {"/items/0/effective": {"eq": "2"}, "/items/0/parts": {"exists": false}, "/items/1/source": {"eq": "object"}}},
|
|
{"tool": "action_run", "args": {"id": "orca_command:undo:orca"}},
|
|
{"tool": "settings_get", "args": {"target": "object", "object": 0, "keys": ["extruder", "wall_loops"]},
|
|
"expect": {"/items/0/effective": {"eq": "1"}, "/items/0/parts/0/value": {"eq": "2"}, "/items/1/value": {"eq": null}, "/items/1/source": {"eq": "global"}}},
|
|
|
|
// ---- Project settings. Entries by index, since a reused datadir may start with more slots ----
|
|
{"tool": "project_get_settings", "args": {"keys": ["filament_is_mixed", "curr_bed_type", "prime_volume_mode"]},
|
|
"expect": {"/items/0/meta/read_only": {"eq": true}, "/items/0/value": {"regex": "^0,0"},
|
|
"/items/1/meta/offered": {"contains": "Textured PEI Plate"}, "/items/2/meta/offered": {"empty": true}}},
|
|
{"tool": "project_set_settings", "args": {"values": {"filament_colour": {"index": 0, "value": "#ffffff"}}},
|
|
"expect": {"/applied/filament_colour": {"regex": "^#FFFFFF;"}}},
|
|
// A colour, the multiplier, one matrix entry and the plate type in one call: the colour goes first, so its
|
|
// recalculated flushing volumes do not replace the entry given.
|
|
{"tool": "project_set_settings", "args": {"values": {"filament_colour": {"index": 1, "value": "#000000"}, "flush_multiplier": 0.7, "flush_volumes_matrix": {"index": 1, "value": 400}, "curr_bed_type": "Textured PEI Plate"}},
|
|
"expect": {"/applied/filament_colour": {"regex": "^#FFFFFF;#000000"}, "/applied/flush_multiplier": {"eq": "0.7"},
|
|
"/applied/flush_volumes_matrix": {"regex": "^0,400,"}, "/applied/curr_bed_type": {"eq": "Textured PEI Plate"}}},
|
|
{"tool": "project_get_settings", "args": {"keys": ["filament_colour", "flush_volumes_matrix", "flush_multiplier", "curr_bed_type"]},
|
|
"expect": {"/items/0/value": {"regex": "^#FFFFFF;#000000"}, "/items/1/value": {"regex": "^0,400,"}, "/items/2/value": {"eq": "0.7"},
|
|
"/items/3/value": {"eq": "Textured PEI Plate"}}},
|
|
// Refused, and nothing changes: a mixed flag, a bad colour together with a valid multiplier, a purge mode the
|
|
// X1C has no button for, a non-zero diagonal.
|
|
{"tool": "project_set_settings", "args": {"values": {"filament_is_mixed": "1"}}, "optional": true},
|
|
{"tool": "project_set_settings", "args": {"values": {"filament_colour": {"index": 0, "value": "white"}, "flush_multiplier": 0.5}},
|
|
"optional": true},
|
|
{"tool": "project_set_settings", "args": {"values": {"prime_volume_mode": "Saving"}}, "optional": true},
|
|
{"tool": "project_set_settings", "args": {"values": {"flush_volumes_matrix": {"index": 0, "value": 10}}}, "optional": true},
|
|
{"tool": "project_get_settings", "args": {"keys": ["filament_colour", "flush_multiplier", "flush_volumes_matrix", "filament_is_mixed"]},
|
|
"expect": {"/items/0/value": {"regex": "^#FFFFFF;"}, "/items/1/value": {"eq": "0.7"}, "/items/2/value": {"regex": "^0,400,"},
|
|
"/items/3/value": {"regex": "^0,0"}}},
|
|
// The prime tower of plate 0, moved twice; undo puts it back where the first move left it.
|
|
{"tool": "project_set_settings", "args": {"values": {"wipe_tower_x": {"index": 0, "value": 150}, "wipe_tower_y": {"index": 0, "value": 180}}},
|
|
"expect": {"/applied/wipe_tower_x": {"regex": "^150(,|$)"}, "/applied/wipe_tower_y": {"regex": "^180(,|$)"}}},
|
|
{"tool": "project_set_settings", "args": {"values": {"wipe_tower_x": {"index": 0, "value": 40}}},
|
|
"expect": {"/applied/wipe_tower_x": {"regex": "^40(,|$)"}}},
|
|
{"tool": "action_run", "args": {"id": "orca_command:undo:orca"}},
|
|
{"tool": "project_get_settings", "args": {"keys": ["wipe_tower_x", "wipe_tower_y"]},
|
|
"expect": {"/items/0/value": {"regex": "^150(,|$)"}, "/items/1/value": {"regex": "^180(,|$)"}}},
|
|
{"tool": "project_set_settings", "args": {"values": {"wipe_tower_x": {"index": 0, "value": 300}}}, "optional": true},
|
|
|
|
{"tool": "plate_slice", "expect": {"/status": {"eq": "done"}, "/plates/0/outcome": {"eq": "ok"}}},
|
|
{"tool": "view_set", "args": {"tab": "prepare", "camera": "iso"}},
|
|
{"tool": "window_screenshot", "args": {"target": "canvas", "save_path": "${out_dir}/filaments.png", "overwrite": true, "include_image": false}},
|
|
// The plate type is remembered per printer; back to the bench datadir's.
|
|
{"tool": "project_set_settings", "args": {"values": {"curr_bed_type": "Cool Plate"}}}
|
|
]
|
|
}
|