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:
1 parent
e4ef6cfe29
commit
a261aaa841
70 files changed
+5860
-101
No files matched your search
@@ -27,6 +27,7 @@ pub struct DocSlot {
|
||||
/// The per-design part of the UI state (what is hidden, shown or locked).
|
||||
#[derive(Clone, Debug, Default)]
|
||||
struct DocView {
|
||||
render: crate::render_workspace::ViewState,
|
||||
sketch_choices: crate::sketch_families::Choices,
|
||||
hidden_profiles: Vec<u64>,
|
||||
shown_dims: Vec<u64>,
|
||||
@@ -64,6 +65,7 @@ impl Documents {
|
||||
fn take_view(app: &mut SolveApp) -> DocView {
|
||||
let u = &mut app.ui;
|
||||
DocView {
|
||||
render: std::mem::take(&mut app.render_workspace.view),
|
||||
sketch_choices: std::mem::take(&mut app.sketch_choices),
|
||||
hidden_profiles: std::mem::take(&mut u.hidden_profiles),
|
||||
shown_dims: std::mem::take(&mut u.shown_dims),
|
||||
@@ -72,6 +74,9 @@ fn take_view(app: &mut SolveApp) -> DocView {
|
||||
}
|
||||
|
||||
fn put_view(app: &mut SolveApp, v: DocView) {
|
||||
app.render_workspace.view = v.render;
|
||||
crate::render_workspace::invalidate_scene(app);
|
||||
crate::render_workspace::sync_backend(app);
|
||||
app.sketch_choices = v.sketch_choices;
|
||||
let u = &mut app.ui;
|
||||
u.hidden_profiles = v.hidden_profiles;
|
||||
@@ -81,6 +86,9 @@ fn put_view(app: &mut SolveApp, v: DocView) {
|
||||
|
||||
/// Put `slot` into the app and return what was there.
|
||||
fn swap_in(app: &mut SolveApp, slot: DocSlot) -> DocSlot {
|
||||
if crate::render_workspace::active(app) {
|
||||
let _ = crate::render_workspace::enter(app, false);
|
||||
}
|
||||
// Whatever was going on in the design leaves with it.
|
||||
crate::sketch_text_move::cancel_drag(app);
|
||||
crate::dialogs::cancel(app);
|
||||
@@ -162,6 +170,7 @@ pub fn adopt(app: &mut SolveApp, session: Session) {
|
||||
app.menu.props = None;
|
||||
crate::sketch_attachment_ui::clear(app);
|
||||
app.session.replace_design(session);
|
||||
crate::render_workspace::reset_document(app);
|
||||
app.sketch_choices = crate::sketch_families::Choices::default();
|
||||
app.session.invalidate_view(rev);
|
||||
app.cam = Camera::default();
|
||||
|
||||
Reference in new issue
Block a user