[Bf-blender-cvs] [b1af6820015] master: Outliner Visibility Update

Dalai Felinto noreply at git.blender.org
Sat May 11 01:00:34 CEST 2019


Commit: b1af682001596fb2943dca3e39a256be71637906
Author: Dalai Felinto
Date:   Sat May 4 14:14:37 2019 -0300
Branches: master
https://developer.blender.org/rBb1af682001596fb2943dca3e39a256be71637906

Outliner Visibility Update

See T61578 for discussions and mockups.

Visibility Options
==================
We are adding more granular control over restriction columns in the outliner,
exposing "indirect only" and "holdout" as options, and change the way
users enable/disable collections in a viewlayer.

We also rename the object viewport restriction to hide instance.

So the options we have are:

Collection
----------
* Render Visibility
* Instance Visibility
* Selectable

(View) Layer Collection
-----------------------
* Enable
* Holdout
* Indirect Only
* Viewport

Shortcuts
=========
Isolate Collection
------------------
* Ctr + click isolates the collection.
It turns all its parents and children "visible", and all the other
collections "invisible".

If ALL the collections were already properly set, we re-set the
collections to their default value.

Set Collection Inside Collections and Objects
---------------------------------------------
* Shift + click: Set/unset inside collections and objects.

We only set objects values as well when we are in View Layer mode and
(obviously) when the objects have a matching property.

Icons
=====
Little reminder that we will need better icons for holdout, indirect only, and
probably instanced (nothing wrong with the current, but it differs from
the proposal when it is turned off).

Also, we need to decide where do we want the modifier/bones/... icons to
be (in which column) and ideally make sure their icons match the ones we
use for collections/objects.

At the moment those are using the screen icon, which is not being used
by collections.

Reviewers: brecht, billrey
Subscribers: pablovazquez
Differential Revision: https://developer.blender.org/D4823

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

M	release/scripts/startup/bl_ui/space_outliner.py
M	source/blender/alembic/intern/abc_transform.cc
M	source/blender/blenkernel/BKE_blender_version.h
M	source/blender/blenkernel/BKE_collection.h
M	source/blender/blenkernel/intern/collection.c
M	source/blender/blenkernel/intern/layer.c
M	source/blender/blenkernel/intern/object_dupli.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
M	source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc
M	source/blender/editors/animation/anim_filter.c
M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/interface/interface.c
M	source/blender/editors/mask/mask_ops.c
M	source/blender/editors/object/object_add.c
M	source/blender/editors/object/object_edit.c
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/space_outliner/outliner_collections.c
M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_edit.c
M	source/blender/editors/space_outliner/outliner_intern.h
M	source/blender/editors/space_outliner/outliner_select.c
M	source/blender/editors/space_outliner/outliner_tree.c
M	source/blender/editors/space_outliner/outliner_utils.c
M	source/blender/editors/space_outliner/space_outliner.c
M	source/blender/makesdna/DNA_collection_types.h
M	source/blender/makesdna/DNA_object_types.h
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/intern/rna_collection.c
M	source/blender/makesrna/intern/rna_layer.c
M	source/blender/makesrna/intern/rna_object.c
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index d64dfbfdfdf..f0f6776805d 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -47,7 +47,7 @@ class OUTLINER_HT_header(Header):
         layout.separator_spacer()
 
         row = layout.row(align=True)
-        if display_mode in {'VIEW_LAYER'}:
+        if display_mode in {'SCENES', 'VIEW_LAYER'}:
             row.popover(
                 panel="OUTLINER_PT_filter",
                 text="",
@@ -303,10 +303,29 @@ class OUTLINER_PT_filter(Panel):
         space = context.space_data
         display_mode = space.display_mode
 
+        if display_mode == 'VIEW_LAYER':
+            layout.label(text="Restriction Toggles:")
+            row = layout.row(align=True)
+            row.prop(space, "show_restrict_column_enable", text="")
+            row.prop(space, "show_restrict_column_selectable", text="")
+            row.prop(space, "show_restrict_column_instance", text="")
+            row.prop(space, "show_restrict_column_viewport", text="")
+            row.prop(space, "show_restrict_column_render", text="")
+            row.prop(space, "show_restrict_column_holdout", text="")
+            row.prop(space, "show_restrict_column_indirect_only", text="")
+            layout.separator()
+        elif display_mode == 'SCENES':
+            layout.label(text="Restriction Toggles:")
+            row = layout.row(align=True)
+            row.prop(space, "show_restrict_column_selectable", text="")
+            row.prop(space, "show_restrict_column_instance", text="")
+            row.prop(space, "show_restrict_column_viewport", text="")
+            row.prop(space, "show_restrict_column_render", text="")
+            layout.separator()
+
         if display_mode != 'DATA_API':
             col = layout.column(align=True)
             col.prop(space, "use_sort_alpha")
-            col.prop(space, "show_restrict_columns")
             layout.separator()
 
         col = layout.column(align=True)
@@ -314,6 +333,9 @@ class OUTLINER_PT_filter(Panel):
         col.prop(space, "use_filter_complete", text="Exact Match")
         col.prop(space, "use_filter_case_sensitive", text="Case Sensitive")
 
+        if display_mode != 'VIEW_LAYER':
+            return
+
         layout.separator()
 
         layout.label(text="Filter:")
diff --git a/source/blender/alembic/intern/abc_transform.cc b/source/blender/alembic/intern/abc_transform.cc
index 8b8ed6c5c4b..1ec23b9dfd0 100644
--- a/source/blender/alembic/intern/abc_transform.cc
+++ b/source/blender/alembic/intern/abc_transform.cc
@@ -86,7 +86,7 @@ void AbcTransformWriter::do_write()
         m_xform, m_xform.getSchema().getTimeSampling());
   }
 
-  m_visibility.set(!(ob_eval->restrictflag & OB_RESTRICT_VIEW));
+  m_visibility.set(!(ob_eval->restrictflag & OB_RESTRICT_INSTANCE));
 
   if (!m_first_frame && !m_is_animated) {
     return;
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index e01f6a6b751..b03686ca241 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -27,7 +27,7 @@
  * \note Use #STRINGIFY() rather than defining with quotes.
  */
 #define BLENDER_VERSION 280
-#define BLENDER_SUBVERSION 60
+#define BLENDER_SUBVERSION 61
 /** Several breakages with 280, e.g. collections vs layers. */
 #define BLENDER_MINVERSION 280
 #define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenkernel/BKE_collection.h b/source/blender/blenkernel/BKE_collection.h
index 47786629aed..0e093bb086b 100644
--- a/source/blender/blenkernel/BKE_collection.h
+++ b/source/blender/blenkernel/BKE_collection.h
@@ -161,6 +161,8 @@ bool BKE_collection_move(struct Main *bmain,
 
 bool BKE_collection_find_cycle(struct Collection *new_ancestor, struct Collection *collection);
 
+bool BKE_collection_has_collection(struct Collection *parent, struct Collection *collection);
+
 /* Iteration callbacks. */
 
 typedef void (*BKE_scene_objects_Cb)(struct Object *ob, void *data);
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index d33d4e344b5..a7d23eff726 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -434,8 +434,8 @@ static void collection_object_cache_fill(ListBase *lb, Collection *collection, i
 
     int object_restrict = base->object->restrictflag;
 
-    if (((child_restrict & COLLECTION_RESTRICT_VIEW) == 0) &&
-        ((object_restrict & OB_RESTRICT_VIEW) == 0)) {
+    if (((child_restrict & COLLECTION_RESTRICT_INSTANCE) == 0) &&
+        ((object_restrict & OB_RESTRICT_INSTANCE) == 0)) {
       base->flag |= BASE_ENABLED_VIEWPORT;
     }
 
@@ -966,6 +966,11 @@ static bool collection_find_child_recursive(Collection *parent, Collection *coll
   return false;
 }
 
+bool BKE_collection_has_collection(Collection *parent, Collection *collection)
+{
+  return collection_find_child_recursive(parent, collection);
+}
+
 static CollectionParent *collection_find_parent(Collection *child, Collection *collection)
 {
   return BLI_findptr(&child->parents, collection, offsetof(CollectionParent, collection));
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index fc349e62809..0eb2252cbfb 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -693,7 +693,7 @@ static short layer_collection_sync(ViewLayer *view_layer,
       lc->runtime_flag = child_runtime_flag;
     }
 
-    if (((child_restrict & COLLECTION_RESTRICT_VIEW) == 0) &&
+    if (((child_restrict & COLLECTION_RESTRICT_INSTANCE) == 0) &&
         ((child_layer_restrict & LAYER_COLLECTION_RESTRICT_VIEW) == 0)) {
       lc->runtime_flag |= LAYER_COLLECTION_VISIBLE;
     }
@@ -723,7 +723,7 @@ static short layer_collection_sync(ViewLayer *view_layer,
         BLI_addtail(new_object_bases, base);
       }
 
-      if ((child_restrict & COLLECTION_RESTRICT_VIEW) == 0) {
+      if ((child_restrict & COLLECTION_RESTRICT_INSTANCE) == 0) {
         base->flag_from_collection |= BASE_ENABLED_VIEWPORT;
         if ((child_layer_restrict & LAYER_COLLECTION_RESTRICT_VIEW) == 0) {
           base->flag_from_collection |= BASE_VISIBLE;
@@ -1014,8 +1014,8 @@ bool BKE_layer_collection_isolate(Scene *scene,
   bool hide_it = extend && (lc->runtime_flag & LAYER_COLLECTION_VISIBLE);
 
   if ((!ID_IS_LINKED(lc->collection) && !hide_it)) {
-    if (lc->collection->flag & COLLECTION_RESTRICT_VIEW) {
-      lc->collection->flag &= ~COLLECTION_RESTRICT_VIEW;
+    if (lc->collection->flag & COLLECTION_RESTRICT_INSTANCE) {
+      lc->collection->flag &= ~COLLECTION_RESTRICT_INSTANCE;
       depsgraph_need_update = true;
     }
   }
@@ -1044,8 +1044,8 @@ bool BKE_layer_collection_isolate(Scene *scene,
 
     while (lc_parent != lc) {
       if (!ID_IS_LINKED(lc_parent->collection)) {
-        if (lc_parent->collection->flag & COLLECTION_RESTRICT_VIEW) {
-          lc_parent->collection->flag &= ~COLLECTION_RESTRICT_VIEW;
+        if (lc_parent->collection->flag & COLLECTION_RESTRICT_INSTANCE) {
+          lc_parent->collection->flag &= ~COLLECTION_RESTRICT_INSTANCE;
           depsgraph_need_update = true;
         }
       }
@@ -1109,8 +1109,8 @@ bool BKE_layer_collection_set_visible(ViewLayer *view_layer,
   bool depsgraph_changed = false;
 
   if (visible && (!ID_IS_LINKED(lc->collection)) &&
-      ((lc->collection->flag & COLLECTION_RESTRICT_VIEW) != 0)) {
-    lc->collection->flag &= ~COLLECTION_RESTRICT_VIEW;
+      ((lc->collection->flag & COLLECTION_RESTRICT_INSTANCE) != 0)) {
+    lc->collection->flag &= ~COLLECTION_RESTRICT_INSTANCE;
     depsgraph_changed = true;
   }
 
@@ -1491,7 +1491,7 @@ void BKE_base_eval_flags(Base *base)
 
   /* Apply object restrictions. */
   const int object_restrict = base->object->restrictflag;
-  if (object_restrict & OB_RESTRICT_VIEW) {
+  if (object_restrict & OB_RESTRICT_INSTANCE) {
     base->flag &= ~BASE_ENABLED_VIEWPORT;
   }
   if (object_restrict & OB_RESTRICT_RENDER) {
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index 8080834a53a..044d6da9466 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -1082,7 +1082,7 @@ static const DupliGenerator *get_dupli_generator(const DupliContext *ctx)
 
   /* Should the dupli's be generated for this object? - Respect restrict flags */
   if (DEG_get_mode(ctx->depsgraph) == DAG_EVAL_RENDER ? (restrictflag & OB_RESTRICT_RENDER) :
-                                                        (restrictflag & OB_RESTRICT_VIEW)) {
+                                                        (restrictflag & OB_RESTRICT_INSTANCE)) {
     return NULL;
   }
 
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index b958d7532bf..66c186d4561 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -427,7 +427,7 @@ static void do_version_layers_to_collections(Main *bmain, Scene *scene)
           collections[layer] = collection;
 
           if (!(scene->lay & (1 << layer))) {
-            collection->flag |= COLLECTION_RESTRICT_VIEW | COLLECTION_RESTRICT_RENDER;
+            collection->flag |= COLLECTION_RESTRICT_INSTANCE | COLLECTION_RESTRICT_RENDER;
           }
         }
 
@@ -728,7 +728,7 @@ void do_versions_after_linking_280(Main *bmain)
       /* Add fake user for all existing groups. */
       id_fake_user_set(&collection->id);
 
-      if (collection->flag & (COLLECTION_RESTRICT_VIEW | COLLECTION_RESTRICT_RENDER)) {
+      if (collection->flag & (COLLECTION_RESTRICT_INSTANCE | COLLECTION_RESTRICT_RENDER)) {
         continue;
       }
 
@@ -754,7 +754,8 @@ void do_versions_after_linking_280(Main *bmain)
             char name[MAX_ID_NAME];
             BLI_snprintf(name, sizeof(name), DATA_("Hidden %d"), coll_idx + 1);
             *collection_hidden = BKE_collection_

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list