Files
OrcaSlicer/tools/mcp/tests/script_basic.json
T

21 lines
1.3 KiB
JSON

// Opens a model, changes a print setting, slices and captures the preview: the smallest end-to-end
// check of --mcp-script. Run from anywhere:
// orca-slicer --mcp-script tools/mcp/tests/script_basic.json --mcp-script-out /tmp/out
{
"orca_script": 1,
"name": "basic slice",
"vars": {"model": "${script_dir}/../../../resources/handy_models/OrcaCube_v2.drc"},
"steps": [
{"tool": "wait", "args": {"for": "ready"}},
{"tool": "new_project", "args": {"discard_changes": true}},
{"tool": "set_view", "args": {"window_size": [1920, 1200]}},
{"tool": "open_files", "args": {"paths": ["${vars.model}"]}, "expect": {"/added": {"eq": 1}}},
{"tool": "set_settings", "args": {"scope": "print", "values": {"wall_loops": 3}}},
{"tool": "get_settings", "args": {"scope": "print", "keys": ["wall_loops"]}, "expect": {"/items/0/value": {"eq": "3"}}},
{"tool": "slice", "expect": {"/status": {"eq": "done"}, "/plates/0/outcome": {"eq": "ok"}}},
{"tool": "set_view", "args": {"tab": "preview", "camera": "iso"}},
{"tool": "screenshot", "args": {"target": "canvas", "save_path": "${out_dir}/preview.png", "overwrite": true, "include_image": false}},
{"tool": "screenshot", "args": {"target": "window", "save_path": "${out_dir}/window.png", "overwrite": true, "include_image": false}}
]
}