Refactor: Rename pass accessor in viewport parameters

No need to state that it is a viewport display pass, since the method
is within viewport parameters it is implied that parameters do belong
to the viewport.

Brings this code closer to the Cycles-X branch.
This commit is contained in:
Sergey Sharybin 2021-05-27 10:42:22 +02:00
parent 06d48367fa
commit bf7a67c5c6
3 changed files with 6 additions and 6 deletions

View File

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

View File

@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "blender_viewport.h"
#include "blender_util.h"
@ -70,7 +71,7 @@ const bool BlenderViewportParameters::custom_viewport_parameters() const
return !(use_scene_world && use_scene_lights);
}
PassType BlenderViewportParameters::get_viewport_display_render_pass(BL::SpaceView3D &b_v3d)
PassType BlenderViewportParameters::get_render_pass(BL::SpaceView3D &b_v3d)
{
PassType display_pass = PASS_NONE;
if (b_v3d) {
@ -84,7 +85,7 @@ PassType BlenderViewportParameters::get_viewport_display_render_pass(BL::SpaceVi
PassType update_viewport_display_passes(BL::SpaceView3D &b_v3d, vector<Pass> &passes)
{
if (b_v3d) {
PassType display_pass = BlenderViewportParameters::get_viewport_display_render_pass(b_v3d);
PassType display_pass = BlenderViewportParameters::get_render_pass(b_v3d);
passes.clear();
Pass::add(display_pass, passes);

View File

@ -44,9 +44,9 @@ class BlenderViewportParameters {
friend class BlenderSync;
public:
/* Retrieve the render pass that needs to be displayed on the given `SpaceView3D`
/* Retrieve the render pass type that needs to be displayed on the given `SpaceView3D`
* When the `b_v3d` parameter is not given `PASS_NONE` will be returned. */
static PassType get_viewport_display_render_pass(BL::SpaceView3D &b_v3d);
static PassType get_render_pass(BL::SpaceView3D &b_v3d);
};
PassType update_viewport_display_passes(BL::SpaceView3D &b_v3d, vector<Pass> &passes);