Files
OrcaSlicer/tools/mcp/tests/scene.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

338 lines
29 KiB
JSON

// Object structure and scene: object_transform on instances, plates and parts, the selection as
// object_select and app_state report it, shapes added at a size without the Primitive size dialog,
// object_arrange, parts added to an object with part_add, and the object list's context-menu commands
// (Change Type, Rename, instances, Assemble, Order By), then all of them on one scene from start to
// slice. Run on a live app:
// python3 tools/mcp/orca_mcp.py run-replay tools/mcp/tests/scene.json --out <dir>
// A refusal can't be asserted directly (a failed step stops the run), so each one is an optional
// step followed by a check that nothing changed.
{
"orca_replay_version": "0.2.0",
"name": "object structure and scene",
"vars": {"cube": "${replay_dir}/../../../resources/handy_models/OrcaCube_v2.drc",
"svg": "${replay_dir}/fixtures/star.svg"},
"steps": [
{"tool": "app_wait", "args": {"for": "ready"}},
{"tool": "project_new", "args": {"discard_changes": true}},
{"tool": "window_set", "args": {"size": [1600, 900]}},
{"tool": "view_set", "args": {"tab": "prepare"}},
// ---- An instance: a scale that grows it drops it onto the bed; size keeps the proportions ----
{"tool": "project_import", "args": {"paths": ["${vars.cube}"]}, "expect": {"/added": {"eq": 1}}},
{"tool": "object_transform", "args": {"object": 0, "scale": 1.5}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/bbox/min/2": {"ge": -0.001, "le": 0.001}}},
{"tool": "object_transform", "args": {"object": 0, "size": [30, null, null]}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/bbox/size/0": {"ge": 29.99, "le": 30.01},
"/plates/0/objects/0/bbox/min/2": {"ge": -0.001, "le": 0.001}}},
{"tool": "object_transform", "args": {"object": 0, "size": [30, 20, 10]}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/bbox/size/1": {"ge": 19.99, "le": 20.01},
"/plates/0/objects/0/bbox/size/2": {"ge": 9.99, "le": 10.01}}},
{"tool": "object_transform", "args": {"object": 0, "size": [30, 30, 30]}},
// ---- A move to another plate registers the instance there, for object_list and slicing ----
{"tool": "action_run", "args": {"id": "orca_command:plate_add:orca"}},
{"tool": "object_transform", "args": {"object": 0, "plate": 1}, "expect": {"/plate": {"eq": 1}}},
{"tool": "object_list", "args": {"plate": 1}, "expect": {"/total": {"eq": 1}, "/plates/0/index": {"eq": 1}, "/plates/0/objects/0/instances/0/index": {"eq": 0}}},
{"tool": "object_transform", "args": {"object": 0, "plate": 0}, "expect": {"/plate": {"eq": 0}}},
{"tool": "object_transform", "args": {"object": 0, "translate": [100, 100, 0], "mode": "absolute"},
"expect": {"/offset/0": {"ge": 99.99, "le": 100.01}, "/plate": {"eq": 0}}},
// ---- A part: the Object manipulation panel's path, measured on instance 0 ----
{"tool": "object_select", "args": {"objects": [0]}},
{"tool": "object_add_svg", "args": {"path": "${vars.svg}"}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "widget_click", "args": {"target": {"gizmo": "SVG"}}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/1/svg/path": {"contains": "star.svg"}}},
{"tool": "object_transform", "args": {"object": 0, "part": 1, "translate": [100, 100, 15], "mode": "absolute"},
"expect": {"/part_info/position/0": {"ge": 99.99, "le": 100.01}, "/part_info/position/1": {"ge": 99.99, "le": 100.01},
"/part_info/position/2": {"ge": 14.99, "le": 15.01}, "/part_info/type": {"eq": "part"}}},
{"tool": "object_transform", "args": {"object": 0, "part": 1, "translate": [5, 0, 0]},
"expect": {"/part_info/position/0": {"ge": 104.99, "le": 105.01}}},
// one undo step per call
{"tool": "action_run", "args": {"id": "orca_command:undo:orca"}},
{"tool": "object_transform", "args": {"object": 0, "part": 1, "translate": [0, 0, 0]},
"expect": {"/part_info/position/0": {"ge": 99.99, "le": 100.01}}},
{"tool": "object_transform", "args": {"object": 0, "part": 1, "scale": 2, "mode": "absolute"},
"expect": {"/part_info/scale/0": {"ge": 1.999, "le": 2.001}, "/part_info/scale/2": {"ge": 1.999, "le": 2.001}}},
{"tool": "object_transform", "args": {"object": 0, "part": 1, "size": [null, null, 3]},
"expect": {"/size/2": {"ge": 2.999, "le": 3.001}}},
{"tool": "object_transform", "args": {"object": 0, "part": 1, "rotate": [0, 0, 45]}},
// refused: an absolute rotation of a part, a part with plate, a single part
{"tool": "object_transform", "args": {"object": 0, "part": 1, "rotate": [0, 0, 0], "mode": "absolute"}, "optional": true},
{"tool": "object_transform", "args": {"object": 0, "part": 1, "plate": 1}, "optional": true},
{"tool": "object_list", "expect": {"/plates/0/objects/0/instances/0/index": {"eq": 0}}},
// ---- What object_list says of the part and the instance: placement on the bed, filament, mirror ----
// The star stands on the face the camera saw, so only orientation-free values are checked; a turn
// about Z keeps its height, and at 0.3 of its size it holds 0.027 of its mesh's volume.
{"tool": "object_list", "expect": {"/plates/0/objects/0/filament": {"eq": 1}, "/plates/0/objects/0/auto_drop": {"eq": true},
"/plates/0/objects/0/instances/0/mirrored": {"eq": false},
"/plates/0/objects/0/instances/0/bbox/min/2": {"ge": -0.001, "le": 0.001},
"/plates/0/objects/0/instances/0/bbox/size/0": {"ge": 29.99, "le": 30.01},
"/plates/0/objects/0/parts/1/filament": {"eq": 1}, "/plates/0/objects/0/parts/1/mirrored": {"eq": false},
"/plates/0/objects/0/parts/1/position/2": {"ge": 14.99, "le": 15.01},
"/plates/0/objects/0/parts/1/bbox/min/2": {"gt": 0, "le": 15},
"/plates/0/objects/0/parts/1/bbox/max/2": {"ge": 15, "lt": 30},
"/plates/0/objects/0/parts/1/mesh_volume": {"gt": 1000},
"/plates/0/objects/0/parts/1/scaled_volume": {"gt": 0, "lt": 100}}},
// a mirrored part is mirrored in the object's frame; an instance mirrored twice is a half turn
{"tool": "object_select", "args": {"parts": [[0, 1]]},
"expect": {"/canvas": {"eq": "3d"}, "/objects": {"eq": [0]}, "/instances": {"eq": [[0, 0]]}, "/parts": {"eq": [[0, 1]]}}},
{"tool": "app_state", "expect": {"/selection/parts": {"eq": [[0, 1]]}, "/python/available": {"eq": true},
"/python/scripts_unrestricted": {"ne": null}, "/design_tab": {"ne": null}}},
{"tool": "action_run", "args": {"id": "orca_command:obj_mirror_x:orca"}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/1/mirrored": {"eq": true}, "/plates/0/objects/0/instances/0/mirrored": {"eq": false}}},
// a whole instance lists no parts
{"tool": "object_select", "args": {"objects": [0]}, "expect": {"/instances": {"eq": [[0, 0]]}, "/parts": {"exists": false}}},
{"tool": "action_run", "args": {"id": "orca_command:obj_mirror_y:orca"}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/instances/0/mirrored": {"eq": true}, "/plates/0/objects/0/instances/0/scale/0": {"gt": 0},
"/plates/0/objects/0/parts/1/mirrored": {"eq": true}}},
{"tool": "action_run", "args": {"id": "orca_command:obj_mirror_x:orca"}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/instances/0/mirrored": {"eq": false}}},
// ---- Shapes at a size, without the dialog ----
{"tool": "object_select", "args": {"none": true}, "expect": {"/empty": {"eq": true}, "/objects": {"empty": true}}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [40, 40, 10]}},
{"tool": "object_list", "expect": {"/total": {"eq": 2}, "/plates/1/objects/0/bbox/size/0": {"ge": 39.99, "le": 40.01},
"/plates/1/objects/0/bbox/size/2": {"ge": 9.99, "le": 10.01}}},
{"tool": "object_transform", "args": {"object": 1, "part": 0, "translate": [1, 0, 0]}, "optional": true},
// a wrong count adds nothing
{"tool": "object_select", "args": {"none": true}},
{"tool": "object_add_primitive", "args": {"shape": "cylinder", "size": [1, 2, 3]}, "optional": true},
{"tool": "object_list", "expect": {"/total": {"eq": 2}}},
// a call with a size adds the shape whatever is selected
{"tool": "object_select", "args": {"objects": [1]}},
{"tool": "object_add_primitive", "args": {"shape": "cylinder", "size": [10, 5]}, "expect": {"/object": {"eq": 2}}},
{"tool": "object_list", "expect": {"/total": {"eq": 3}}},
// ---- Fill bed fills the object's own plate, in one undo step ----
// The shapes were added on the current plate, plate 1; the cube goes back to plate 0.
{"tool": "object_transform", "args": {"object": 1, "plate": 0}, "expect": {"/plate": {"eq": 0}}},
{"tool": "object_arrange", "args": {"fill_object": 2}, "expect": {"/added": {"gt": 0}, "/plate": {"eq": 1}, "/off_plate": {"empty": true}}},
// The new instances are listed on the plate they fill.
{"tool": "object_list", "expect": {"/plates/1/objects/0/instances/1": {"exists": true}, "/outside": {"empty": true}}},
{"tool": "action_run", "args": {"id": "orca_command:undo:orca"}},
{"tool": "object_list", "expect": {"/plates/1/objects/0/instances/1": {"exists": false}, "/outside": {"empty": true}}},
// refused: a locked plate, a plate that does not exist, fill_object with plates
{"tool": "plate_select", "args": {"plate": 1}},
{"tool": "action_run", "args": {"id": "orca_command:plate_toggle_lock:orca"}},
{"tool": "object_arrange", "args": {"plates": 1}, "optional": true},
{"tool": "action_run", "args": {"id": "orca_command:plate_toggle_lock:orca"}},
{"tool": "object_arrange", "args": {"plates": 7}, "optional": true},
{"tool": "object_arrange", "args": {"fill_object": 0, "plates": 0}, "optional": true},
{"tool": "object_list", "expect": {"/plates/1": {"exists": true}, "/plates/2": {"exists": false}, "/plates/1/objects/0/instances/0/index": {"eq": 0},
"/plates/1/objects/0/instances/1": {"exists": false}}},
// ---- Arrange one plate with options; the other plate keeps its object (arrange may reorder objects) ----
{"tool": "object_arrange", "args": {"plates": 0, "spacing": 10, "rotate": false, "align_y": false},
"expect": {"/off_plate": {"empty": true}, "/plates": {"eq": 2}, "/settings/spacing": {"eq": 10},
"/settings/rotate": {"eq": false}}},
{"tool": "object_list", "args": {"plate": 1}, "expect": {"/total": {"eq": 1}, "/plates/0/objects/0/name": {"eq": "Cylinder"}}},
{"tool": "object_list", "args": {"plate": 0}, "expect": {"/total": {"eq": 2}}},
// every plate with the saved options, which is Auto-Arrange; the obj_arrange tile runs the same call and replies as it
{"tool": "object_arrange", "args": {}, "expect": {"/settings/spacing": {"eq": 10}, "/off_plate": {"empty": true}}},
{"tool": "action_run", "args": {"id": "orca_command:obj_arrange:orca"}, "expect": {"/settings/spacing": {"eq": 10}, "/off_plate": {"empty": true}}},
// a Speed Dial command that does nothing (no selection) is an error step
{"tool": "object_select", "args": {"none": true}},
{"tool": "action_run", "args": {"id": "orca_command:obj_mirror_x:orca"}, "optional": true},
// ---- part_add: the context menu's Add items, with a size, a file or a position, one undo step each ----
{"tool": "project_new", "args": {"discard_changes": true}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [40, 40, 10]}},
{"tool": "object_transform", "args": {"object": 0, "translate": [100, 100, 5], "mode": "absolute"}},
// a magnet pocket at the bottom centre
{"tool": "part_add", "args": {"object": 0, "type": "negative", "shape": "cylinder", "size": [6.2, 3.2],
"position": [100, 100, 1.6]},
"expect": {"/part": {"eq": 1}, "/part_count": {"eq": 2}, "/part_info/type": {"eq": "negative"},
"/part_info/position/0": {"ge": 99.99, "le": 100.01}, "/part_info/position/1": {"ge": 99.99, "le": 100.01},
"/part_info/bbox/min/2": {"ge": -0.01, "le": 0.01}, "/part_info/bbox/size/2": {"ge": 3.19, "le": 3.21},
"/part_info/bbox/size/0": {"ge": 6.1, "le": 6.21}}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/1/mesh_volume": {"gt": 90},
"/plates/0/objects/0/bbox/size/2": {"ge": 9.99, "le": 10.01}}},
{"tool": "action_run", "args": {"id": "orca_command:undo:orca"}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/1": {"exists": false}}},
{"tool": "action_run", "args": {"id": "orca_command:redo:orca"}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/1/type": {"eq": "negative"}}},
// a modifier from a file, where Load... puts it; parts are ordered by type (part, negative, modifier)
{"tool": "part_add", "args": {"object": 0, "type": "modifier", "path": "${vars.cube}"},
"expect": {"/part": {"eq": 2}, "/part_count": {"eq": 3}, "/part_info/type": {"eq": "modifier"},
"/part_info/name": {"eq": "OrcaCube_v2.drc"}}},
// a solid part at a size takes the object's filament and grows the object; the built-in size for the rest
{"tool": "part_add", "args": {"object": 0, "type": "part", "shape": "cube", "size": [10, 10, 20], "position": [125, 100, 10]},
"expect": {"/part": {"eq": 1}, "/part_info/type": {"eq": "part"}, "/part_info/filament": {"eq": 1},
"/part_info/bbox/size/2": {"ge": 19.99, "le": 20.01}}},
{"tool": "part_add", "args": {"object": 0, "type": "support_blocker", "shape": "sphere", "position": [110, 110, 10]},
"expect": {"/part_info/type": {"eq": "support_blocker"}, "/part_info/position/2": {"ge": 9.99, "le": 10.01}}},
{"tool": "part_add", "args": {"object": 0, "type": "precise_seam", "shape": "cube", "size": [2, 2, 2]},
"expect": {"/part_info/type": {"eq": "precise_seam"}, "/part_info/subtype": {"eq": "center"}}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/2/type": {"eq": "negative"}, "/plates/0/objects/0/parts/3/type": {"eq": "modifier"},
"/plates/0/objects/0/parts/5": {"exists": true}, "/plates/0/objects/0/parts/6": {"exists": false},
"/plates/0/objects/0/bbox/size/2": {"ge": 19.99, "le": 20.01}}},
// refused, adding nothing: shape and path, a size with the wrong count, an SVG file, a file that is
// not a model, an object with two instances
{"tool": "part_add", "args": {"object": 0, "type": "modifier", "shape": "cube", "path": "${vars.cube}"}, "optional": true},
{"tool": "part_add", "args": {"object": 0, "type": "modifier", "shape": "cylinder", "size": [1, 2, 3]}, "optional": true},
{"tool": "part_add", "args": {"object": 0, "type": "part", "path": "${vars.svg}"}, "optional": true},
{"tool": "part_add", "args": {"object": 0, "type": "modifier", "path": "${replay_dir}/fixtures/heightmap.png"}, "optional": true},
{"tool": "object_select", "args": {"objects": [0]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_instances_up:orca"}},
{"tool": "part_add", "args": {"object": 0, "type": "modifier", "shape": "cube"}, "optional": true},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/6": {"exists": false}, "/plates/0/objects/0/instances/1": {"exists": true}}},
// the selection names the instances it is in
{"tool": "object_select", "args": {"instances": [[0, 1]]}, "expect": {"/objects": {"eq": [0]}, "/instances": {"eq": [[0, 1]]}}},
{"tool": "object_select", "args": {"objects": [0]}, "expect": {"/instances": {"eq": [[0, 0], [0, 1]]}}},
{"tool": "app_state", "expect": {"/selection/instances": {"eq": [[0, 0], [0, 1]]}}},
{"tool": "action_run", "args": {"id": "orca_command:obj_instances_down:orca"}},
// a shape folds the instance's scale into the parts, as the menu does
{"tool": "object_select", "args": {"none": true}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 20]}},
{"tool": "object_transform", "args": {"object": 1, "scale": 1.5}},
{"tool": "part_add", "args": {"object": 1, "type": "modifier", "shape": "cube"}, "expect": {"/part": {"eq": 1}}},
{"tool": "object_list", "expect": {"/plates/0/objects/1/instances/0/scale/0": {"ge": 0.999, "le": 1.001},
"/plates/0/objects/1/bbox/size/0": {"ge": 29.99, "le": 30.01},
"/plates/0/objects/1/parts/0/scale/0": {"ge": 1.499, "le": 1.501}}},
// ---- Object structure commands: the context menus' Change Type, Rename, number of instances,
// Set as Individual Objects and Assemble, each an action_run on what object_select picked ----
{"tool": "project_new", "args": {"discard_changes": true}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [30, 30, 10]}},
{"tool": "part_add", "args": {"object": 0, "type": "modifier", "shape": "cube", "size": [10, 10, 10]}, "expect": {"/part": {"eq": 1}}},
// Change Type, one undo step each; a seam made a part again is listed after the first part
{"tool": "object_select", "args": {"parts": [[0, 1]]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_type_negative:orca"}, "expect": {"/level": {"eq": "success"}}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/1/type": {"eq": "negative"}}},
{"tool": "action_run", "args": {"id": "orca_command:obj_type_support_blocker:orca"}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/1/type": {"eq": "support_blocker"}}},
{"tool": "action_run", "args": {"id": "orca_command:undo:orca"}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/1/type": {"eq": "negative"}}},
{"tool": "object_select", "args": {"parts": [[0, 1]]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_type_precise_seam:orca"}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/1/type": {"eq": "precise_seam"}, "/plates/0/objects/0/parts/1/subtype": {"eq": "center"}}},
{"tool": "object_select", "args": {"parts": [[0, 1]]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_type_part:orca"}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/0/type": {"eq": "part"}, "/plates/0/objects/0/parts/1/type": {"eq": "part"}}},
{"tool": "object_select", "args": {"parts": [[0, 1]]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_type_modifier:orca"}},
// refused, changing nothing: the object's last solid part, and an object's row, which is not a part
{"tool": "object_select", "args": {"parts": [[0, 0]]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_type_modifier:orca"}, "optional": true},
{"tool": "object_select", "args": {"objects": [0]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_type_part:orca"}, "optional": true},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/0/type": {"eq": "part"}, "/plates/0/objects/0/parts/1/type": {"eq": "modifier"}}},
// refused: an SVG part stays a part, a modifier or a negative part
{"tool": "object_add_svg", "args": {"path": "${vars.svg}"}},
{"tool": "app_wait", "args": {"for": "idle"}},
{"tool": "widget_click", "args": {"target": {"gizmo": "SVG"}}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/1/svg/path": {"contains": "star.svg"}, "/plates/0/objects/0/parts/2/type": {"eq": "modifier"}}},
{"tool": "object_select", "args": {"parts": [[0, 1]]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_type_support_enforcer:orca"}, "optional": true},
{"tool": "object_list", "expect": {"/plates/0/objects/0/parts/1/type": {"eq": "part"}}},
// Rename an object and a part; refused: a name a file name cannot hold
{"tool": "object_select", "args": {"objects": [0]}},
{"tool": "object_rename", "args": {"name": "base"}},
{"tool": "object_select", "args": {"parts": [[0, 2]]}},
{"tool": "object_rename", "args": {"name": "infill zone"}},
{"tool": "object_rename", "args": {"name": "a/b"}, "optional": true},
{"tool": "object_list", "expect": {"/plates/0/objects/0/name": {"eq": "base"}, "/plates/0/objects/0/parts/2/name": {"eq": "infill zone"}}},
// a number of instances in one undo step; refused: 0 and a word
{"tool": "object_select", "args": {"none": true}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 20]}},
{"tool": "object_select", "args": {"objects": [1]}},
{"tool": "object_set_instances", "args": {"count": 6},
"expect": {"/object": {"eq": 1}, "/instances": {"eq": 6}}},
{"tool": "action_run", "args": {"id": "orca_command:undo:orca"}},
{"tool": "object_list", "expect": {"/plates/0/objects/1/instances/1": {"exists": false}}},
{"tool": "object_select", "args": {"objects": [1]}},
{"tool": "object_set_instances", "args": {"count": 3}},
{"tool": "object_set_instances", "args": {"count": 0}, "optional": true},
{"tool": "object_set_instances", "args": {"count": "three"}, "optional": true},
{"tool": "object_list", "expect": {"/total": {"eq": 2}, "/plates/0/objects/1/instances/2": {"exists": true}, "/plates/0/objects/1/instances/3": {"exists": false}}},
// every instance its own object (the whole object selected), then two of them assembled
{"tool": "object_select", "args": {"objects": [1]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_instances_to_objects:orca"},
"expect": {"/objects/0/index": {"eq": 1}, "/objects/2/index": {"eq": 3}}},
{"tool": "object_list", "expect": {"/total": {"eq": 4}, "/plates/0/objects/3/instances/1": {"exists": false}}},
{"tool": "object_select", "args": {"objects": [1]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_instances_to_objects:orca"}, "optional": true},
{"tool": "object_select", "args": {"objects": [2, 3]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_assemble:orca"}, "expect": {"/object": {"eq": 2}, "/name": {"eq": "Assembly"}}},
{"tool": "object_list", "expect": {"/total": {"eq": 3}, "/plates/0/objects/2/name": {"eq": "Assembly"}, "/plates/0/objects/2/parts/1": {"exists": true}}},
{"tool": "object_select", "args": {"objects": [0]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_assemble:orca"}, "optional": true},
{"tool": "object_list", "expect": {"/total": {"eq": 3}}},
// ---- Order By: ascending, reversed when run again, and the reply says which ----
{"tool": "project_new", "args": {"discard_changes": true}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 30]}},
{"tool": "object_select", "args": {"none": true}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 10]}},
{"tool": "object_select", "args": {"none": true}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [20, 20, 20]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_order_by_height:orca"},
"expect": {"/descending": {"eq": false}, "/order/2/object": {"eq": 2}, "/order/2/plate": {"eq": 0}}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/bbox/size/2": {"ge": 9.99, "le": 10.01}, "/plates/0/objects/2/bbox/size/2": {"ge": 29.99, "le": 30.01}}},
{"tool": "action_run", "args": {"id": "orca_command:obj_order_by_height:orca"}, "expect": {"/descending": {"eq": true}}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/bbox/size/2": {"ge": 29.99, "le": 30.01}}},
// refused: an empty current plate, an all that is not true or false; all orders every plate
{"tool": "action_run", "args": {"id": "orca_command:plate_add:orca"}},
{"tool": "plate_select", "args": {"plate": 1}},
{"tool": "action_run", "args": {"id": "orca_command:obj_order_by_size:orca"}, "optional": true},
{"tool": "object_order", "args": {"by": "size", "all": "every"}, "optional": true},
{"tool": "object_list", "expect": {"/plates/0/objects/0/bbox/size/2": {"ge": 29.99, "le": 30.01}}},
{"tool": "object_order", "args": {"by": "size", "all": true},
"expect": {"/descending": {"eq": false}, "/order/0/plate": {"eq": 0}, "/order/3": {"exists": false}}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/bbox/size/2": {"ge": 9.99, "le": 10.01}}},
// ---- End to end: a block with a magnet pocket and a boss, sized on the bed, moved to a second
// plate, six copies arranged apart there, each made its own object, one mirrored, two assembled,
// all ordered by name, the plate filled with one of them, and the plate sliced ----
{"tool": "project_new", "args": {"discard_changes": true}},
{"tool": "object_add_primitive", "args": {"shape": "cube", "size": [40, 40, 10]}},
{"tool": "object_transform", "args": {"object": 0, "translate": [100, 100, 5], "mode": "absolute"}},
{"tool": "part_add", "args": {"object": 0, "type": "negative", "shape": "cylinder", "size": [6.2, 3.2],
"position": [100, 100, 1.6]}, "expect": {"/part": {"eq": 1}}},
// a boss on top; solid parts are listed before negative ones
{"tool": "part_add", "args": {"object": 0, "type": "part", "shape": "cylinder", "size": [10, 5], "position": [100, 100, 12.5]},
"expect": {"/part": {"eq": 1}, "/part_count": {"eq": 3}, "/part_info/bbox/min/2": {"ge": 9.99, "le": 10.01}}},
{"tool": "object_select", "args": {"parts": [[0, 1]]}},
{"tool": "object_rename", "args": {"name": "boss"}},
{"tool": "object_transform", "args": {"object": 0, "part": 1, "translate": [5, 0, 0]},
"expect": {"/part_info/name": {"eq": "boss"}, "/part_info/position/0": {"ge": 104.99, "le": 105.01}}},
// 50 mm wide in proportion, so 1.25 x (10 + 5) mm tall, and still on the bed
{"tool": "object_transform", "args": {"object": 0, "size": [50, null, null]}},
{"tool": "object_list", "expect": {"/plates/0/objects/0/bbox/size/0": {"ge": 49.99, "le": 50.01},
"/plates/0/objects/0/bbox/size/2": {"ge": 18.74, "le": 18.76},
"/plates/0/objects/0/bbox/min/2": {"ge": -0.001, "le": 0.001},
"/plates/0/objects/0/parts/2/type": {"eq": "negative"}}},
{"tool": "action_run", "args": {"id": "orca_command:plate_add:orca"}},
{"tool": "object_transform", "args": {"object": 0, "plate": 1}, "expect": {"/plate": {"eq": 1}}},
// six copies, overlapping where Set Number of Instances puts them, spread out on plate 1 alone
{"tool": "object_select", "args": {"objects": [0]}},
{"tool": "object_set_instances", "args": {"count": 6}, "expect": {"/instances": {"eq": 6}}},
{"tool": "object_arrange", "args": {"plates": 1, "spacing": 10, "rotate": false},
"expect": {"/off_plate": {"empty": true}, "/settings/spacing": {"eq": 10}, "/plates": {"eq": 2}}},
{"tool": "object_list", "args": {"plate": 0}, "expect": {"/total": {"eq": 0}}},
{"tool": "object_list", "args": {"plate": 1}, "expect": {"/plates/0/objects/0/instances/5/index": {"eq": 5}}},
// every instance its own object (the whole object selected), each with the three parts
{"tool": "object_select", "args": {"objects": [0]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_instances_to_objects:orca"}, "expect": {"/objects/5/index": {"eq": 5}}},
{"tool": "object_list", "expect": {"/total": {"eq": 6}, "/plates/1/objects/5/parts/1/name": {"eq": "boss"},
"/plates/1/objects/5/parts/2/type": {"eq": "negative"}, "/plates/1/objects/5/instances/0/index": {"eq": 0}}},
{"tool": "object_select", "args": {"objects": [5]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_mirror_x:orca"}},
{"tool": "object_list", "expect": {"/plates/1/objects/5/instances/0/mirrored": {"eq": true}, "/plates/1/objects/4/instances/0/mirrored": {"eq": false}}},
// two assembled into one object, which goes last; the mirrored one moves up to index 3
{"tool": "object_select", "args": {"objects": [0, 1]}},
{"tool": "action_run", "args": {"id": "orca_command:obj_assemble:orca"}, "expect": {"/object": {"eq": 4}, "/name": {"eq": "Assembly"}}},
{"tool": "object_list", "expect": {"/total": {"eq": 5}, "/plates/1/objects/4/parts/5": {"exists": true},
"/plates/1/objects/4/bbox/min/2": {"ge": -0.001, "le": 0.001},
"/plates/1/objects/3/instances/0/mirrored": {"eq": true}}},
{"tool": "object_order", "args": {"by": "name", "all": true},
"expect": {"/descending": {"eq": false}, "/order/0/name": {"eq": "Assembly"}, "/order/4/plate": {"eq": 1}}},
{"tool": "object_arrange", "args": {"fill_object": 1}, "expect": {"/added": {"gt": 0}, "/plate": {"eq": 1}, "/off_plate": {"empty": true}}},
{"tool": "plate_slice", "args": {"plates": 1}, "expect": {"/plates/0/outcome": {"eq": "ok"}}},
{"tool": "view_set", "args": {"tab": "prepare"}},
{"tool": "window_screenshot","args": {"target": "canvas", "save_path": "${out_dir}/scene.png", "overwrite": true, "include_image": false}}
]
}