`SolveApp::start` now honours a command's enabled flag, so shortcuts, the command palette and the control channel can't start a disabled command, and Move is disabled while a sketch is open.
38 lines
2.0 KiB
JSON
38 lines
2.0 KiB
JSON
[
|
|
{"note": "solid.move moves bodies. While a sketch is being edited it can do nothing to the geometry under the cursor, so it is disabled there rather than opening a window that cannot act. The refusal says why, and the command comes back once the sketch is finished."},
|
|
{"call": "engine.execute", "params": {"command": "solid.box", "params": {"length": 20, "width": 20, "height": 20}}},
|
|
{"call": "ui.view", "params": {"view": "iso"}},
|
|
|
|
{"note": "With no sketch open it works as before: the window opens on a picked body."},
|
|
{"start": "solid.move"},
|
|
{"click": {"world": [10, 10, 20]}},
|
|
{"expect": {"dialog": "Move", "bodies": 1}},
|
|
{"key": "Escape"},
|
|
{"expect": {"dialog": null}},
|
|
|
|
{"note": "Inside a sketch the same press opens nothing and leaves the sketch alone."},
|
|
{"call": "engine.execute", "params": {"command": "sketch.create", "params": {"plane": "XZ"}}},
|
|
{"call": "engine.execute", "params": {"command": "sketch.rectangle.two_point", "params": {"p0": [40, 0], "p1": [80, 20]}}},
|
|
{"expect": {"sketching": true, "sketch_curves": {"own": 4}}},
|
|
{"start": "solid.move"},
|
|
{"expect": {"dialog": null, "tool": null, "sketching": true}},
|
|
{"expect": {"status": "a sketch is being edited"}},
|
|
{"expect": {"status": "Finish Sketch first"}},
|
|
|
|
{"note": "The engine refuses it too, so a script cannot walk around the greyed button."},
|
|
{"call": "engine.execute", "params": {"command": "solid.move", "params": {"bodies": ["Body1"], "translate": [30, 0, 0]}}, "fail": true},
|
|
{"expect": {"sketching": true, "bodies": 1, "errors": 0}},
|
|
{"expect": {"bbox": {"body": "Body1", "min": [0, 0, 0], "max": [20, 20, 20]}}},
|
|
|
|
{"note": "Finish the sketch and Move is back, with the body still where it was."},
|
|
{"start": "sketch.finish"},
|
|
{"expect": {"sketching": false}},
|
|
{"start": "solid.move"},
|
|
{"click": {"world": [10, 10, 20]}},
|
|
{"expect": {"dialog": "Move"}},
|
|
{"key": "Escape"},
|
|
{"expect": {"dialog": null, "bodies": 1, "errors": 0}},
|
|
{"expect": {"bbox": {"body": "Body1", "min": [0, 0, 0], "max": [20, 20, 20]}}},
|
|
{"shot": "move_disabled_in_sketch"}
|
|
]
|