[Bf-blender-cvs] [9bc1d7a6dee] master: Fix T72584: Hiding a collection don't hide a child object in viewport when in Local View

Manuel Castilla noreply at git.blender.org
Mon Sep 14 09:25:55 CEST 2020


Commit: 9bc1d7a6deea8f401d727e80f42a04482c29bcef
Author: Manuel Castilla
Date:   Mon Sep 14 09:13:29 2020 +0200
Branches: master
https://developer.blender.org/rB9bc1d7a6deea8f401d727e80f42a04482c29bcef

Fix T72584: Hiding a collection don't hide a child object in viewport when in Local View

Hiding a collection should hide all children objects even when we are in Local
view with one of them.

Note from reviewer: We are doing this already for local collections. So
may as well do it when hiding the collections for the entire view layer.

Developer details: In function "BKE_object_is_visible_in_viewport" object flag
BASE_VISIBLE_VIEWLAYER wasn't being checked when we were in Local view,
It's now changed so that it's checked even if we are in Local view.
And this function was called by some viewport draw functions to check if it
should draw an object or not.

Maniphest Tasks: T72584

Differential Revision: https://developer.blender.org/D7894

===================================================================

M	source/blender/blenkernel/intern/layer.c

===================================================================

diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 1ad34fde0fa..dd8a22e10da 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -1111,8 +1111,8 @@ bool BKE_object_is_visible_in_viewport(const View3D *v3d, const struct Object *o
     return false;
   }
 
-  /* If not using local view or local collection the object may still be in a hidden collection. */
-  if (((v3d->localvd) == NULL) && ((v3d->flag & V3D_LOCAL_COLLECTIONS) == 0)) {
+  /* If not using local collection the object may still be in a hidden collection. */
+  if ((v3d->flag & V3D_LOCAL_COLLECTIONS) == 0) {
     return (ob->base_flag & BASE_VISIBLE_VIEWLAYER) != 0;
   }



More information about the Bf-blender-cvs mailing list