Render: integrated workspace, preview image jobs and opaque PBR (#1046)

Lands the Render workspace (R3), bounded preview-image jobs with cancellation and atomic PNG export (R4a), and opaque PBR looks as one change.

- Render workspace: an overlay-free product preview on the installed GPU device. Returning to Design restores its camera. render.scene and render.settings.apply are added.
- Image jobs: render.preflight/start/status/cancel/export run bounded CPU preview jobs. Export captures the job, overwrite choice and document, and checks the caller's file scope before writing.
- Opaque PBR: looks can carry metal fraction, roughness and dielectric IOR. The product viewport and preview PNG use them; geometry and mass are unchanged. The v1 catalog export refuses PBR rather than dropping it.
- Render setups and PBR looks are saved under design format 21. Labels are in en/de/ja/ko/zh/ru.

Supersedes #706 and #800. Refs #620, #673, #756, #1004.

Contributed by @0xlillith.

Co-authored-by: lillith <35337584+0xlillith@users.noreply.github.com>
This commit is contained in:
selune authored and GitHub committed 2026-10-14 19:24:36 -04:00
1 parent e4ef6cfe29
commit a261aaa841
70 files changed
+5860 -101

No files matched your search

+32
View File
@@ -218,3 +218,35 @@ fn catalog_inspection_export_and_no_clobber_do_not_touch_design_or_history() {
assert!(s.execute(command, &json!({"path":file.0,"unknown":true})).is_err());
}
}
#[test]
fn lossy_scalar_export_never_creates_or_replaces_a_file_or_changes_history() {
let mut s = session();
s.execute(
"appearance.assign",
&json!({"bodies":["Body1"],"color":[180,120,70],
"pbr":{"metallic":1.0,"roughness":0.3,"dielectric_ior":1.5}}),
)
.unwrap();
s.mark_saved();
let doc = s.doc.clone();
let history = (s.undo.len(), s.redo.len(), s.revision);
for existing in [false, true] {
let file = File::new();
if existing {
std::fs::write(&file.0, b"preserve existing library").unwrap();
}
for overwrite in [false, true] {
let error = s.execute("library.export", &json!({"path":file.0,"overwrite":overwrite})).unwrap_err();
assert!(error.to_string().contains("cannot preserve PBR"));
if existing {
assert_eq!(std::fs::read(&file.0).unwrap(), b"preserve existing library");
} else {
assert!(!std::path::Path::new(&file.0).exists());
}
assert!(Arc::ptr_eq(&doc, &s.doc));
assert_eq!((s.undo.len(), s.redo.len(), s.revision), history);
assert!(!s.is_dirty());
}
}
}