diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2019-05-14 23:45:47 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2019-05-15 00:10:25 +0300 |
commit | 777a546c0c789648f0f75315333d99e58050cd09 (patch) | |
tree | a0cd7fd54d8d894f9c1ef9368d49ed167087b539 /source/blender/blenkernel | |
parent | 903041e1c0eaf1797573f193be6d5561a907278e (diff) |
Outliner Restriction: Naming sanitization and icon
No major API change here, only in the outliner restriction column
variables (e.g., show_restrict_column_selectable > show_restrict_column_select).
* Get rid of _INSTANCE (introduced on b1af68200159).
* Differentiate (everywhere but the API) between HIDE (temporary) and VIEWPORT (global).
* Use the expected icon for restrict viewport (same as objects and modifiers).
* selectable > select
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/collection.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 38 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.c | 2 |
3 files changed, 22 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index a7d23eff726..87f448d8d57 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_INSTANCE) == 0) && - ((object_restrict & OB_RESTRICT_INSTANCE) == 0)) { + if (((child_restrict & COLLECTION_RESTRICT_VIEWPORT) == 0) && + ((object_restrict & OB_RESTRICT_VIEWPORT) == 0)) { base->flag |= BASE_ENABLED_VIEWPORT; } diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 0eb2252cbfb..99e6c99ec0c 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -693,8 +693,8 @@ static short layer_collection_sync(ViewLayer *view_layer, lc->runtime_flag = child_runtime_flag; } - if (((child_restrict & COLLECTION_RESTRICT_INSTANCE) == 0) && - ((child_layer_restrict & LAYER_COLLECTION_RESTRICT_VIEW) == 0)) { + if (((child_restrict & COLLECTION_RESTRICT_VIEWPORT) == 0) && + ((child_layer_restrict & LAYER_COLLECTION_HIDE) == 0)) { lc->runtime_flag |= LAYER_COLLECTION_VISIBLE; } @@ -723,9 +723,9 @@ static short layer_collection_sync(ViewLayer *view_layer, BLI_addtail(new_object_bases, base); } - if ((child_restrict & COLLECTION_RESTRICT_INSTANCE) == 0) { + if ((child_restrict & COLLECTION_RESTRICT_VIEWPORT) == 0) { base->flag_from_collection |= BASE_ENABLED_VIEWPORT; - if ((child_layer_restrict & LAYER_COLLECTION_RESTRICT_VIEW) == 0) { + if ((child_layer_restrict & LAYER_COLLECTION_HIDE) == 0) { base->flag_from_collection |= BASE_VISIBLE; if (((child_restrict & COLLECTION_RESTRICT_SELECT) == 0)) { base->flag_from_collection |= BASE_SELECTABLE; @@ -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_INSTANCE) { - lc->collection->flag &= ~COLLECTION_RESTRICT_INSTANCE; + if (lc->collection->flag & COLLECTION_RESTRICT_VIEWPORT) { + lc->collection->flag &= ~COLLECTION_RESTRICT_VIEWPORT; depsgraph_need_update = true; } } @@ -1024,13 +1024,13 @@ bool BKE_layer_collection_isolate(Scene *scene, /* Hide all collections . */ for (LayerCollection *lc_iter = lc_master->layer_collections.first; lc_iter; lc_iter = lc_iter->next) { - layer_collection_flag_set_recursive(lc_iter, LAYER_COLLECTION_RESTRICT_VIEW); + layer_collection_flag_set_recursive(lc_iter, LAYER_COLLECTION_HIDE); } } /* Make all the direct parents visible. */ if (hide_it) { - lc->flag |= LAYER_COLLECTION_RESTRICT_VIEW; + lc->flag |= LAYER_COLLECTION_HIDE; } else { LayerCollection *lc_parent = lc; @@ -1044,13 +1044,13 @@ 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_INSTANCE) { - lc_parent->collection->flag &= ~COLLECTION_RESTRICT_INSTANCE; + if (lc_parent->collection->flag & COLLECTION_RESTRICT_VIEWPORT) { + lc_parent->collection->flag &= ~COLLECTION_RESTRICT_VIEWPORT; depsgraph_need_update = true; } } - lc_parent->flag &= ~LAYER_COLLECTION_RESTRICT_VIEW; + lc_parent->flag &= ~LAYER_COLLECTION_HIDE; for (LayerCollection *lc_iter = lc_parent->layer_collections.first; lc_iter; lc_iter = lc_iter->next) { @@ -1062,7 +1062,7 @@ bool BKE_layer_collection_isolate(Scene *scene, } /* Make all the children visible, but respect their disable state. */ - layer_collection_flag_unset_recursive(lc, LAYER_COLLECTION_RESTRICT_VIEW); + layer_collection_flag_unset_recursive(lc, LAYER_COLLECTION_HIDE); BKE_layer_collection_activate(view_layer, lc); } @@ -1109,27 +1109,27 @@ 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_INSTANCE) != 0)) { - lc->collection->flag &= ~COLLECTION_RESTRICT_INSTANCE; + ((lc->collection->flag & COLLECTION_RESTRICT_VIEWPORT) != 0)) { + lc->collection->flag &= ~COLLECTION_RESTRICT_VIEWPORT; depsgraph_changed = true; } if (hierarchy) { if (visible) { - layer_collection_flag_unset_recursive(lc, LAYER_COLLECTION_RESTRICT_VIEW); + layer_collection_flag_unset_recursive(lc, LAYER_COLLECTION_HIDE); layer_collection_bases_show_recursive(view_layer, lc); } else { - layer_collection_flag_set_recursive(lc, LAYER_COLLECTION_RESTRICT_VIEW); + layer_collection_flag_set_recursive(lc, LAYER_COLLECTION_HIDE); layer_collection_bases_hide_recursive(view_layer, lc); } } else { if (visible) { - lc->flag &= ~LAYER_COLLECTION_RESTRICT_VIEW; + lc->flag &= ~LAYER_COLLECTION_HIDE; } else { - lc->flag |= LAYER_COLLECTION_RESTRICT_VIEW; + lc->flag |= LAYER_COLLECTION_HIDE; } } return depsgraph_changed; @@ -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_INSTANCE) { + if (object_restrict & OB_RESTRICT_VIEWPORT) { 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 044d6da9466..0dedbb7e934 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_INSTANCE)) { + (restrictflag & OB_RESTRICT_VIEWPORT)) { return NULL; } |