refactor(automation): drop screenshot.viewport3d, keep only screenshot.window

The on-screen window capture is composited from the desktop framebuffer, so it
already includes the GL 3D viewport as currently shown (model in the editor,
toolpaths in Preview). The offscreen render_thumbnail path only ever drew the
model GLVolumeCollection — never the gcode toolpaths — and produced a blank image
after slicing because the app switches to the Preview panel. Rather than maintain a
second, more limited capture method, remove it entirely.

Removes the JSON-RPC method, IUiBackend/WxUiBackend implementation, dispatcher
route + capability entry, the now-dead opt_int/thumbnail_to_wximage helpers and
ThumbnailData include, the mock override + unit test, and the Python
screenshot_3d client method. Docs updated accordingly.
This commit is contained in:
SoftFever
2026-06-03 18:05:23 +08:00
parent 952696fd1f
commit 892b33bac5
10 changed files with 25 additions and 129 deletions

View File

@@ -1,5 +1,5 @@
"""End-to-end smoke test: launch OrcaSlicer with the automation server, load a
model, slice it, wait for completion, and save both a window PNG and a 3D PNG.
model, slice it, wait for completion, and save a window PNG.
Run:
python example_slice.py --orca /path/to/OrcaSlicer --model /path/to/cube.stl
@@ -56,11 +56,12 @@ def main() -> int:
orca.wait_for({"id": "btn_export"}, state="enabled", timeout_ms=180000,
poll_ms=500)
# The window screenshot is captured from the on-screen composited
# framebuffer, so it already includes the 3D viewport (model in the
# editor, or toolpaths in Preview after slicing).
with open("window.png", "wb") as f:
f.write(orca.screenshot())
with open("preview_3d.png", "wb") as f:
f.write(orca.screenshot_3d(width=1920, height=1080))
print("wrote window.png and preview_3d.png")
print("wrote window.png")
return 0
finally:
proc.terminate()