From 1da0685076bbddaaa9eb20366f07b5d552f03eb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Tue, 18 Aug 2020 12:15:46 +0200 Subject: Cycles: add a Pass Node The Pass struct is now a Node and the passes are moved from the Film class to the Scene class. The Pass Node only has `type` and `name` as sockets as those seem to be the only properties settable by exporters (other properties are implicit and depend on the pass type). This is part of T79131. Reviewed By: brecht Differential Revision: https://developer.blender.org/D8591 --- intern/cycles/blender/blender_session.cpp | 4 ++-- intern/cycles/blender/blender_sync.cpp | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'intern/cycles/blender') diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index a06030c8b7d..fb704b2a24a 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -645,7 +645,7 @@ void BlenderSession::bake(BL::Depsgraph &b_depsgraph_, /* Passes are identified by name, so in order to return the combined pass we need to set the * name. */ - Pass::add(PASS_COMBINED, scene->film->passes, "Combined"); + Pass::add(PASS_COMBINED, scene->passes, "Combined"); session->read_bake_tile_cb = function_bind(&BlenderSession::read_render_tile, this, _1); session->write_render_tile_cb = function_bind(&BlenderSession::write_render_tile, this, _1); @@ -678,7 +678,7 @@ void BlenderSession::bake(BL::Depsgraph &b_depsgraph_, BufferParams buffer_params; buffer_params.width = bake_width; buffer_params.height = bake_height; - buffer_params.passes = scene->film->passes; + buffer_params.passes = scene->passes; /* Update session. */ session->tile_manager.set_samples(session_params.samples); diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 511061db08a..f0b5ab087bb 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -372,8 +372,10 @@ void BlenderSync::sync_film(BL::SpaceView3D &b_v3d) Film *film = scene->film; Film prevfilm = *film; + vector prevpasses = scene->passes; + if (b_v3d) { - film->display_pass = update_viewport_display_passes(b_v3d, film->passes); + film->display_pass = update_viewport_display_passes(b_v3d, scene->passes); } film->exposure = get_float(cscene, "film_exposure"); @@ -403,7 +405,11 @@ void BlenderSync::sync_film(BL::SpaceView3D &b_v3d) if (film->modified(prevfilm)) { film->tag_update(scene); - film->tag_passes_update(scene, prevfilm.passes, false); + } + + if (!Pass::equals(prevpasses, scene->passes)) { + film->tag_passes_update(scene, prevpasses, false); + film->tag_update(scene); } } -- cgit v1.2.3