Refactor: Move display pass to Cycles viewport parameters

Allows to centralize storage and modification checks in a single place,
avoiding duplication in the synchronization code.

Ideally we would somehow be able to more granularly modify Cycles side
objects. Leaving this for a future decision, because it might be better
to implement it as a graph on the sync side.
This commit is contained in:
2021-05-27 11:31:03 +02:00
parent 7b5f4c8837
commit 2414a5787d
3 changed files with 38 additions and 35 deletions

View File

@@ -230,12 +230,7 @@ void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d
has_updates_ = true;
}
if (!has_updates_) {
Film *film = scene->film;
const PassType new_display_pass = new_viewport_parameters.get_render_pass(b_v3d);
has_updates_ |= film->get_display_pass() != new_display_pass;
}
has_updates_ |= viewport_parameters.modified(new_viewport_parameters);
}
}