diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-11-28 16:05:08 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-11-28 16:34:13 +0300 |
commit | 2bd62b076fac80e073557a7d1dff0e989aaa97c1 (patch) | |
tree | 3d914dafe6a58c656fc4096dc24396cb2ef3be94 /source | |
parent | cb9c4b4552d30f9c35e4d9dfe1fe007fb010de29 (diff) |
Outliner/visibility: revert changes for now until we find better solutions.
See T57857 for discussion. This reverts:
"Outliner: Do not gray out empty collections"
4521d3e7074d2e08ca813e1f4a2297f5000f335b.
"Remove eye column from the outliner"
fd16b359977c8932ada8db4ff0e43d0402fdc280.
Fix/workaround issues in pose and edit mode"
6d2e2e30d50c40f302b62d3601b5742d7c7056c6.
"Per view-layer collection visibility"
4de6a210c69fe254518ca8d6c860782c54f03749.
Diffstat (limited to 'source')
12 files changed, 118 insertions, 124 deletions
diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h index 5e0d3f6c5a5..e98fa189379 100644 --- a/source/blender/blenkernel/BKE_layer.h +++ b/source/blender/blenkernel/BKE_layer.h @@ -113,8 +113,6 @@ bool BKE_layer_collection_objects_select( struct ViewLayer *view_layer, struct LayerCollection *lc, bool deselect); bool BKE_layer_collection_has_selected_objects( struct ViewLayer *view_layer, struct LayerCollection *lc); -bool BKE_layer_collection_has_layer_collection( - struct LayerCollection *lc_parent, struct LayerCollection *lc_child); void BKE_base_set_visible(struct Scene *scene, struct ViewLayer *view_layer, struct Base *base, bool extend); void BKE_layer_collection_set_visible(struct Scene *scene, struct ViewLayer *view_layer, struct LayerCollection *lc, bool extend); diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 76960fbc088..9931c29a8c2 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -610,7 +610,7 @@ int BKE_layer_collection_findindex(ViewLayer *view_layer, const LayerCollection static short layer_collection_sync( ViewLayer *view_layer, const ListBase *lb_scene, ListBase *lb_layer, ListBase *new_object_bases, - short parent_exclude, short parent_restrict, short parent_layer_restrict) + short parent_exclude, short parent_restrict) { /* TODO: support recovery after removal of intermediate collections, reordering, .. * For local edits we can make editing operating do the appropriate thing, but for @@ -655,17 +655,15 @@ static short layer_collection_sync( /* Collection restrict is inherited. */ short child_restrict = parent_restrict; - short child_layer_restrict = parent_layer_restrict; if (!(collection->flag & COLLECTION_IS_MASTER)) { child_restrict |= collection->flag; - child_layer_restrict |= lc->flag; } /* Sync child collections. */ short child_runtime_flag = layer_collection_sync( view_layer, &collection->children, &lc->layer_collections, new_object_bases, - lc->flag, child_restrict, child_layer_restrict); + lc->flag, child_restrict); /* Layer collection exclude is not inherited. */ if (lc->flag & LAYER_COLLECTION_EXCLUDE) { @@ -676,10 +674,6 @@ static short layer_collection_sync( lc->runtime_flag = child_runtime_flag; } - if ((child_layer_restrict & LAYER_COLLECTION_RESTRICT_VIEW) == 0) { - lc->runtime_flag |= LAYER_COLLECTION_VISIBLE; - } - /* Sync objects, except if collection was excluded. */ for (CollectionObject *cob = collection->gobject.first; cob; cob = cob->next) { if (cob->ob == NULL) { @@ -707,7 +701,6 @@ static short layer_collection_sync( int object_restrict = base->object->restrictflag; if (((child_restrict & COLLECTION_RESTRICT_VIEW) == 0) && - ((child_layer_restrict & LAYER_COLLECTION_RESTRICT_VIEW) == 0) && ((object_restrict & OB_RESTRICT_VIEW) == 0)) { base->flag |= BASE_VISIBLE | BASE_ENABLED | BASE_ENABLED_VIEWPORT; @@ -721,6 +714,7 @@ static short layer_collection_sync( if (((child_restrict & COLLECTION_RESTRICT_RENDER) == 0) && ((object_restrict & OB_RESTRICT_RENDER) == 0)) + { base->flag |= BASE_ENABLED_RENDER; } @@ -797,11 +791,11 @@ void BKE_layer_collection_sync(const Scene *scene, ViewLayer *view_layer) const ListBase collections = {&child, &child}; ListBase new_object_bases = {NULL, NULL}; - const short parent_exclude = 0, parent_restrict = 0, parent_layer_restrict = 0; + const short parent_exclude = 0, parent_restrict = 0; layer_collection_sync( view_layer, &collections, &view_layer->layer_collections, &new_object_bases, - parent_exclude, parent_restrict, parent_layer_restrict); + parent_exclude, parent_restrict); /* Any remaning object bases are to be removed. */ for (Base *base = view_layer->object_bases.first; base; base = base->next) { @@ -925,7 +919,7 @@ bool BKE_layer_collection_has_selected_objects(ViewLayer *view_layer, LayerColle for (CollectionObject *cob = lc->collection->gobject.first; cob; cob = cob->next) { Base *base = BKE_view_layer_base_find(view_layer, cob->ob); - if (base && (base->flag & BASE_SELECTED) && (base->flag & BASE_VISIBLE)) { + if (base && (base->flag & BASE_SELECTED)) { return true; } } @@ -940,20 +934,6 @@ bool BKE_layer_collection_has_selected_objects(ViewLayer *view_layer, LayerColle return false; } -bool BKE_layer_collection_has_layer_collection(LayerCollection *lc_parent, LayerCollection *lc_child) -{ - if (lc_parent == lc_child) { - return true; - } - - for (LayerCollection *lc_iter = lc_parent->layer_collections.first; lc_iter; lc_iter = lc_iter->next) { - if (BKE_layer_collection_has_layer_collection(lc_iter, lc_child)) { - return true; - } - } - return false; -} - /* ---------------------------------------------------------------------- */ /* Update after toggling visibility of an object base. */ @@ -975,62 +955,44 @@ void BKE_base_set_visible(Scene *scene, ViewLayer *view_layer, Base *base, bool BKE_layer_collection_sync(scene, view_layer); } -static void layer_collection_flag_set_recursive(LayerCollection *lc, const int flag) -{ - lc->flag |= flag; - for (LayerCollection *lc_iter = lc->layer_collections.first; lc_iter; lc_iter = lc_iter->next) { - layer_collection_flag_set_recursive(lc_iter, flag); - } -} - -static void layer_collection_flag_unset_recursive(LayerCollection *lc, const int flag) -{ - lc->flag &= ~flag; - for (LayerCollection *lc_iter = lc->layer_collections.first; lc_iter; lc_iter = lc_iter->next) { - layer_collection_flag_unset_recursive(lc_iter, flag); - } -} - -/** - * Set collection per-view layer visiblity. - * When not extending, we show all the direct parents and all children of the layer collection. - */ void BKE_layer_collection_set_visible(Scene *scene, ViewLayer *view_layer, LayerCollection *lc, bool extend) { if (!extend) { - /* Make only this collection visible. */ - for (LayerCollection *lc_iter = view_layer->layer_collections.first; lc_iter; lc_iter = lc_iter->next) { - layer_collection_flag_set_recursive(lc_iter, LAYER_COLLECTION_RESTRICT_VIEW); - } - - /* Make all the direct parents visible. */ - LayerCollection *lc_parent = lc; - LayerCollection *lc_master = view_layer->layer_collections.first; - for (LayerCollection *lc_iter = lc_master->layer_collections.first; lc_iter; lc_iter = lc_iter->next) { - if (BKE_layer_collection_has_layer_collection(lc_iter, lc)) { - lc_parent = lc_iter; - break; - } + /* Make only objects from one collection visible. */ + for (Base *base = view_layer->object_bases.first; base; base = base->next) { + base->flag |= BASE_HIDDEN; } - while (lc_parent != lc) { - lc_parent->flag &= ~LAYER_COLLECTION_RESTRICT_VIEW; + FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(lc->collection, ob) + { + Base *base = BLI_ghash_lookup(view_layer->object_bases_hash, ob); - for (LayerCollection *lc_iter = lc_parent->layer_collections.first; lc_iter; lc_iter = lc_iter->next) { - if (BKE_layer_collection_has_layer_collection(lc_iter, lc)) { - lc_parent = lc_iter; - break; - } + if (base) { + base->flag &= ~BASE_HIDDEN; } } - - /* Make all the children visible. */ - layer_collection_flag_unset_recursive(lc, LAYER_COLLECTION_RESTRICT_VIEW); + FOREACH_COLLECTION_OBJECT_RECURSIVE_END; BKE_layer_collection_activate(view_layer, lc); } else { - lc->flag ^= LAYER_COLLECTION_RESTRICT_VIEW; + /* Toggle visibility of objects from collection. */ + bool hide = (lc->runtime_flag & LAYER_COLLECTION_HAS_VISIBLE_OBJECTS) != 0; + + FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(lc->collection, ob) + { + Base *base = BLI_ghash_lookup(view_layer->object_bases_hash, ob); + + if (base) { + if (hide) { + base->flag |= BASE_HIDDEN; + } + else { + base->flag &= ~BASE_HIDDEN; + } + } + } + FOREACH_COLLECTION_OBJECT_RECURSIVE_END; } BKE_layer_collection_sync(scene, view_layer); @@ -1139,7 +1101,7 @@ typedef struct LayerObjectBaseIteratorData { Base *base; } LayerObjectBaseIteratorData; -static bool object_bases_iterator_is_valid_ex(View3D *v3d, Base *base, const int flags) +static bool object_bases_iterator_is_valid_ex(View3D *v3d, Base *base, const int flag) { if (v3d != NULL) { if ((v3d->object_type_exclude_viewport & (1 << base->object->type)) != 0) { @@ -1150,12 +1112,12 @@ static bool object_bases_iterator_is_valid_ex(View3D *v3d, Base *base, const int return false; } } - /* Any flag satisfies the condition. */ - if (flags == ~0) { - return (base->flag != 0); + + if ((base->flag & flag) == 0) { + return false; } - /* flags may be more than one flag, so we can't check != 0. */ - return ((base->flag & flags) == flags); + + return true; } static bool object_bases_iterator_is_valid(View3D *v3d, Base *base) @@ -1243,12 +1205,12 @@ static void objects_iterator_end(BLI_Iterator *iter) void BKE_view_layer_selected_objects_iterator_begin(BLI_Iterator *iter, void *data_in) { - objects_iterator_begin(iter, data_in, BASE_VISIBLE | BASE_SELECTED); + objects_iterator_begin(iter, data_in, BASE_SELECTED); } void BKE_view_layer_selected_objects_iterator_next(BLI_Iterator *iter) { - objects_iterator_next(iter, BASE_VISIBLE | BASE_SELECTED); + objects_iterator_next(iter, BASE_SELECTED); } void BKE_view_layer_selected_objects_iterator_end(BLI_Iterator *iter) @@ -1285,7 +1247,7 @@ void BKE_view_layer_visible_objects_iterator_end(BLI_Iterator *iter) void BKE_view_layer_selected_editable_objects_iterator_begin(BLI_Iterator *iter, void *data_in) { - objects_iterator_begin(iter, data_in, BASE_VISIBLE | BASE_SELECTED); + objects_iterator_begin(iter, data_in, BASE_SELECTED); if (iter->valid) { if (BKE_object_is_libdata((Object *)iter->current) == false) { // First object is valid (selectable and not libdata) -> all good. @@ -1302,7 +1264,7 @@ void BKE_view_layer_selected_editable_objects_iterator_next(BLI_Iterator *iter) { // Search while there are objects and the one we have is not editable (editable = not libdata). do { - objects_iterator_next(iter, BASE_VISIBLE | BASE_SELECTED); + objects_iterator_next(iter, BASE_SELECTED); } while (iter->valid && BKE_object_is_libdata((Object *)iter->current) != false); } @@ -1319,12 +1281,12 @@ void BKE_view_layer_selected_editable_objects_iterator_end(BLI_Iterator *iter) void BKE_view_layer_selected_bases_iterator_begin(BLI_Iterator *iter, void *data_in) { - objects_iterator_begin(iter, data_in, BASE_VISIBLE | BASE_SELECTED); + objects_iterator_begin(iter, data_in, BASE_SELECTED); } void BKE_view_layer_selected_bases_iterator_next(BLI_Iterator *iter) { - object_bases_iterator_next(iter, BASE_VISIBLE | BASE_SELECTED); + object_bases_iterator_next(iter, BASE_SELECTED); } void BKE_view_layer_selected_bases_iterator_end(BLI_Iterator *iter) diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc index 2fff8bae2b2..70bd533647c 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc @@ -71,11 +71,6 @@ void DepsgraphNodeBuilder::build_layer_collections(ListBase *lb) COLLECTION_RESTRICT_VIEW : COLLECTION_RESTRICT_RENDER; for (LayerCollection *lc = (LayerCollection *)lb->first; lc; lc = lc->next) { - if ((graph_->mode == DAG_EVAL_VIEWPORT) && - ((lc->flag & LAYER_COLLECTION_RESTRICT_VIEW) != 0)) - { - continue; - } if (lc->collection->flag & restrict_flag) { continue; } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc index 6c85803dabe..999508cffed 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_view_layer.cc @@ -75,11 +75,6 @@ void DepsgraphRelationBuilder::build_layer_collections(ListBase *lb) COLLECTION_RESTRICT_VIEW : COLLECTION_RESTRICT_RENDER; for (LayerCollection *lc = (LayerCollection *)lb->first; lc; lc = lc->next) { - if ((graph_->mode == DAG_EVAL_VIEWPORT) && - ((lc->flag & LAYER_COLLECTION_RESTRICT_VIEW) != 0)) - { - continue; - } if ((lc->collection->flag & restrict_flag)) { continue; } diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index df1e67efb2d..5852fcff7e9 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -295,7 +295,6 @@ static int object_hide_collection_exec(bContext *C, wmOperator *op) BKE_layer_collection_set_visible(scene, view_layer, lc, extend); - DEG_relations_tag_update(CTX_data_main(C)); DEG_id_tag_update(&scene->id, DEG_TAG_BASE_FLAGS_UPDATE); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); @@ -369,7 +368,7 @@ static int object_hide_collection_invoke(bContext *C, wmOperator *op, const wmEv void OBJECT_OT_hide_collection(wmOperatorType *ot) { /* identifiers */ - ot->name = "Hide Collection"; + ot->name = "Hide Objects By Collection"; ot->description = "Show only objects in collection (Shift to extend)"; ot->idname = "OBJECT_OT_hide_collection"; diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index df7eb07c4d0..cb7d4f1fee9 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -203,9 +203,6 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult if (v3d && ((v3d->object_type_exclude_viewport & (1 << base->object->type)) != 0)) { continue; } - if ((base->flag & BASE_VISIBLE) == 0) { - continue; - } if ((base->flag & BASE_SELECTED) != 0) { CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base); } @@ -221,9 +218,6 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult if (v3d && ((v3d->object_type_exclude_viewport & (1 << base->object->type)) != 0)) { continue; } - if ((base->flag & BASE_VISIBLE) == 0) { - continue; - } if ((base->flag & BASE_SELECTED) != 0) { if (0 == BKE_object_is_libdata(base->object)) { CTX_data_list_add(result, &scene->id, &RNA_ObjectBase, base); diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index d4abf216359..722ed393492 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -274,6 +274,44 @@ static void restrictbutton_id_user_toggle(bContext *UNUSED(C), void *poin, void } } +static void hidebutton_base_flag_cb(bContext *C, void *poin, void *poin2) +{ + Scene *scene = CTX_data_scene(C); + ViewLayer *view_layer = poin; + Base *base = poin2; + bool extend = (CTX_wm_window(C)->eventstate->ctrl == 0); + + /* Undo button toggle, let function do it. */ + base->flag ^= BASE_HIDDEN; + + BKE_base_set_visible(scene, view_layer, base, extend); + + if (!extend && (base->flag & BASE_VISIBLE)) { + /* Auto select solo-ed object. */ + ED_object_base_select(base, BA_SELECT); + view_layer->basact = base; + } + + DEG_id_tag_update(&scene->id, DEG_TAG_BASE_FLAGS_UPDATE); + WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); +} + +static void hidebutton_layer_collection_flag_cb(bContext *C, void *poin, void *poin2) +{ + Scene *scene = CTX_data_scene(C); + ViewLayer *view_layer = poin; + LayerCollection *lc = poin2; + bool extend = (CTX_wm_window(C)->eventstate->ctrl == 0); + + /* Undo button toggle, let function do it. */ + lc->runtime_flag ^= LAYER_COLLECTION_HAS_VISIBLE_OBJECTS; + + BKE_layer_collection_set_visible(scene, view_layer, lc, extend); + + DEG_id_tag_update(&scene->id, DEG_TAG_BASE_FLAGS_UPDATE); + WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); +} + static void namebutton_cb(bContext *C, void *tsep, char *oldname) { Main *bmain = CTX_data_main(C); @@ -487,6 +525,18 @@ static void outliner_draw_restrictbuts( } else if (tselem->type == 0 && te->idcode == ID_OB) { Object *ob = (Object *)tselem->id; + Base *base = BKE_view_layer_base_find(view_layer, ob); + + if (base) { + bt = uiDefIconButBitS( + block, UI_BTYPE_ICON_TOGGLE, BASE_HIDDEN, 0, ICON_HIDE_OFF, + (int)(ar->v2d.cur.xmax - OL_TOG_HIDEX), te->ys, UI_UNIT_X, + UI_UNIT_Y, &base->flag, 0, 0, 0, 0, + TIP_("Hide object in viewport (Ctrl to isolate)")); + UI_but_func_set(bt, hidebutton_base_flag_cb, view_layer, base); + UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); + UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE); + } PointerRNA ptr; RNA_pointer_create(&ob->id, &RNA_Object, ob, &ptr); @@ -598,6 +648,17 @@ static void outliner_draw_restrictbuts( if ((!lc || !(lc->flag & LAYER_COLLECTION_EXCLUDE)) && !(collection->flag & COLLECTION_IS_MASTER)) { + if (lc && (lc->runtime_flag & LAYER_COLLECTION_HAS_ENABLED_OBJECTS)) { + bt = uiDefIconButBitS( + block, UI_BTYPE_ICON_TOGGLE_N, LAYER_COLLECTION_HAS_VISIBLE_OBJECTS, 0, ICON_HIDE_OFF, + (int)(ar->v2d.cur.xmax - OL_TOG_HIDEX), te->ys, UI_UNIT_X, + UI_UNIT_Y, &lc->runtime_flag, 0, 0, 0, 0, + TIP_("Hide collection in viewport (Ctrl to isolate)")); + UI_but_func_set(bt, hidebutton_layer_collection_flag_cb, view_layer, lc); + UI_but_flag_enable(bt, UI_BUT_DRAG_LOCK); + UI_but_drawflag_enable(bt, UI_BUT_ICON_REVERSE); + } + PointerRNA collection_ptr; RNA_id_pointer_create(&collection->id, &collection_ptr); @@ -2059,7 +2120,10 @@ static void outliner_draw_restrictcols(ARegion *ar) uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformThemeColorShadeAlpha(TH_BACK, -15, -200); - immBegin(GPU_PRIM_LINES, 6); + immBegin(GPU_PRIM_LINES, 8); + + immVertex2i(pos, (int)(ar->v2d.cur.xmax - OL_TOG_HIDEX), (int)ar->v2d.cur.ymax); + immVertex2i(pos, (int)(ar->v2d.cur.xmax - OL_TOG_HIDEX), (int)ar->v2d.cur.ymin); immVertex2i(pos, (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), (int)ar->v2d.cur.ymax); immVertex2i(pos, (int)(ar->v2d.cur.xmax - OL_TOG_RESTRICT_VIEWX), (int)ar->v2d.cur.ymin); diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 172d0b433f2..41a0dce7a38 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -129,11 +129,12 @@ typedef enum { /* size constants */ #define OL_Y_OFFSET 2 +#define OL_TOG_HIDEX (UI_UNIT_X * 4.0f + V2D_SCROLL_WIDTH) #define OL_TOG_RESTRICT_SELECTX (UI_UNIT_X * 3.0f + V2D_SCROLL_WIDTH) #define OL_TOG_RESTRICT_VIEWX (UI_UNIT_X * 2.0f + V2D_SCROLL_WIDTH) #define OL_TOG_RESTRICT_RENDERX (UI_UNIT_X + V2D_SCROLL_WIDTH) -#define OL_TOGW OL_TOG_RESTRICT_SELECTX +#define OL_TOGW OL_TOG_HIDEX #define OL_RNA_COLX (UI_UNIT_X * 15) #define OL_RNA_COL_SIZEX (UI_UNIT_X * 7.5f) diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 2a21b73e9bd..902235779cf 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1314,7 +1314,10 @@ static void outliner_add_layer_collections_recursive( ten->directdata = lc; const bool exclude = (lc->flag & LAYER_COLLECTION_EXCLUDE) != 0; - if (exclude) { + if (exclude || + ((layer->runtime_flag & VIEW_LAYER_HAS_HIDE) && + !(lc->runtime_flag & LAYER_COLLECTION_HAS_VISIBLE_OBJECTS))) + { ten->flag |= TE_DISABLED; } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 47bde2a9af7..0fca84074f5 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5906,8 +5906,7 @@ static int count_proportional_objects(TransInfo *t) for (Base *base = view_layer->object_bases.first; base; base = base->next) { /* all base not already selected or marked that is editable */ if ((base->object->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 && - ((base->flag & BASE_VISIBLE) != 0 && - (base->flag & BASE_SELECTED) == 0) && + (base->flag & BASE_SELECTED) == 0 && (BASE_EDITABLE_BGMODE(v3d, base))) { mark_children(base->object); @@ -5921,8 +5920,7 @@ static int count_proportional_objects(TransInfo *t) * selection and it is editable. */ if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 && - ((base->flag & BASE_VISIBLE) != 0 && - (base->flag & BASE_SELECTED) == 0) && + (base->flag & BASE_SELECTED) == 0 && (BASE_EDITABLE_BGMODE(v3d, base))) { flush_trans_object_base_deps_flag(depsgraph, ob); diff --git a/source/blender/makesdna/DNA_layer_types.h b/source/blender/makesdna/DNA_layer_types.h index 8cc305d9203..c3e819c5538 100644 --- a/source/blender/makesdna/DNA_layer_types.h +++ b/source/blender/makesdna/DNA_layer_types.h @@ -117,7 +117,6 @@ enum { LAYER_COLLECTION_EXCLUDE = (1 << 4), LAYER_COLLECTION_HOLDOUT = (1 << 5), LAYER_COLLECTION_INDIRECT_ONLY = (1 << 6), - LAYER_COLLECTION_RESTRICT_VIEW = (1 << 7), }; /* Layer Collection->runtime_flag */ @@ -126,7 +125,6 @@ enum { LAYER_COLLECTION_HAS_VISIBLE_OBJECTS = (1 << 1), LAYER_COLLECTION_HAS_HIDDEN_OBJECTS = (1 << 2), LAYER_COLLECTION_HAS_ENABLED_OBJECTS = (1 << 3), - LAYER_COLLECTION_VISIBLE = (1 << 4), }; /* ViewLayer->flag */ diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index cdb87169a45..46d1f5bef7d 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -297,19 +297,6 @@ static void rna_def_layer_collection(BlenderRNA *brna) "in the view layer"); RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_LayerCollection_use_update"); - prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", LAYER_COLLECTION_RESTRICT_VIEW); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); - RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1); - RNA_def_property_ui_text(prop, "Disable Viewport", "Disable collection in viewport for this view layer"); - RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollection_use_update"); - - prop = RNA_def_property(srna, "is_visible", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "runtime_flag", LAYER_COLLECTION_VISIBLE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Visible", - "Whether this collection is visible, take into account the collection parent"); - func = RNA_def_function(srna, "has_objects", "rna_LayerCollection_has_objects"); RNA_def_function_ui_description(func, ""); RNA_def_function_return(func, RNA_def_boolean(func, "result", 0, "", "")); |