Fix T72302: Only hide objects if their collection is visible
authorRobert Guetzkow <rjg>
Wed, 15 Jan 2020 11:06:21 +0000 (12:06 +0100)
committerDalai Felinto <dfelinto@gmail.com>
Wed, 15 Jan 2020 11:21:45 +0000 (12:21 +0100)
In Blender 2.80 Shift + H (`object_hide_view_set(unselected=True)`) used to
(temporarily) hide objects only if their collection was visible in the current
view layer.

This behavior was changed in rB0812949bbc3d7acfd1f20a47087ff973110aa177 (D5992)
by using `BASE_VISIBLE_DEPSGRAPH` for the decision which object's (temporary)
visibility should remain unchanged. Since the view layer visibility and depsgraph
visibility has been decoupled in said commit, the correct condition
to check is `BASE_VISIBLE_VIEWLAYER`.

This patch is a fix for T72302

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

source/blender/editors/object/object_edit.c

index 8012565ba2e3b38a551aee407d5b76404947fdce..34e1b3b2b4b2f73d6b60678e943d36e8e39f423f 100644 (file)
@@ -218,7 +218,7 @@ static int object_hide_view_set_exec(bContext *C, wmOperator *op)
 
   /* Hide selected or unselected objects. */
   for (Base *base = view_layer->object_bases.first; base; base = base->next) {
-    if (!(base->flag & BASE_VISIBLE_DEPSGRAPH)) {
+    if (!(base->flag & BASE_VISIBLE_VIEWLAYER)) {
       continue;
     }