From 280d6b03a7a9c35d5b50fdeaf03a43f72c3a8059 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 9 Oct 2019 19:02:56 -0300 Subject: Fix T70670: Hidden collections are still rendered by Cycles in the Viewport Now local collections are fully working with cycles preview, while the collection visibility bug is fixed. Local collections were not working with cycles viewport even before the recent commit to allow users to show collections that are hidden in the view layer. It just got worse with said commit (0812949bbc3d). Differential Revision: https://developer.blender.org/D6034 --- intern/cycles/blender/blender_object.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'intern/cycles') diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index 59509d20fb2..d3efc18a990 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -541,7 +541,6 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph, const bool show_lights = BlenderViewportParameters(b_v3d).use_scene_lights; BL::ViewLayer b_view_layer = b_depsgraph.view_layer_eval(); - const bool has_local_view = b_v3d && b_v3d.local_view(); BL::Depsgraph::object_instances_iterator b_instance_iter; for (b_depsgraph.object_instances.begin(b_instance_iter); @@ -555,10 +554,10 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph, /* test if object needs to be hidden */ const bool show_self = b_instance.show_self(); - const bool show_local_view = !has_local_view || b_ob.local_view_get(b_v3d); const bool show_particles = b_instance.show_particles(); + const bool show_in_viewport = b_ob.visible_in_viewport_get(b_v3d); - if (show_local_view && (show_self || show_particles)) { + if (show_in_viewport && (show_self || show_particles)) { /* object itself */ sync_object(b_depsgraph, b_view_layer, -- cgit v1.2.3