Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2019-05-04 20:14:37 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-05-11 01:48:33 +0300
commitb1af682001596fb2943dca3e39a256be71637906 (patch)
tree59fa8a74e10fccd3de6799f98ea9cb861d4accb8 /source/blender/blenkernel/intern
parentde9d846353bdc48a2d3388e79309342df7d003df (diff)
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
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/collection.c9
-rw-r--r--source/blender/blenkernel/intern/layer.c18
-rw-r--r--source/blender/blenkernel/intern/object_dupli.c2
3 files changed, 17 insertions, 12 deletions
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;
}