feat: view.apply restores a named view or camera; MCP screenshot takes a named view or camera (#528) (#595)

New view.apply command restores a named view, a standard view or any camera (view state, not an undo step); the desktop viewport follows it and the browser's Restore uses it. The MCP screenshot tool takes a named view or a camera. Un-ignores the #528 regression test. Fixes #528.

Co-authored-by: jonaswre <jonas.wrede@beyondit.gmbh>
This commit is contained in:
Jonas Wrede authored and GitHub committed 2026-10-13 05:22:52 -04:00
1 parent e67cc0c747
commit 27f20f97cb
11 files changed
+159 -23

No files matched your search

+2 -4
View File
@@ -862,10 +862,8 @@ pub fn restore_view(app: &mut SolveApp, name: &str) {
app.animate_view(v);
return;
}
let Some(v) = app.session.doc.named_views.iter().find(|v| v.name == name) else { return };
let j = json!({ "target": v.target, "yaw": v.yaw, "pitch": v.pitch, "distance": v.distance, "fov": v.fov });
if let Ok(cam) = serde_json::from_value::<solidcraft_engine::render::Camera>(j) {
app.animate_to(cam);
if app.run("view.apply", json!({ "view": name })).is_ok() {
app.follow_view_request(true);
}
}