From 66c23ea2b4a4eb66490a8b9b6c57ed60ec934a42 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Sat, 9 Feb 2019 18:41:52 -0200 Subject: Cleanup: Use ID_IS_LINKED instead of id.lib --- source/blender/editors/space_outliner/outliner_collections.c | 2 +- source/blender/editors/space_outliner/outliner_draw.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c index 92c68681a54..ee4b2bc9ef9 100644 --- a/source/blender/editors/space_outliner/outliner_collections.c +++ b/source/blender/editors/space_outliner/outliner_collections.c @@ -1065,7 +1065,7 @@ static int collection_flag_exec(bContext *C, wmOperator *op) GSET_ITER(collections_to_edit_iter, data.collections_to_edit) { LayerCollection *layer_collection = BLI_gsetIterator_getKey(&collections_to_edit_iter); Collection *collection = layer_collection->collection; - if (collection->id.lib != NULL) { + if (ID_IS_LINKED(collection)) { continue; } if (clear) { diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index f10861b3fbf..37c224d0856 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -276,16 +276,16 @@ static void hidebutton_base_flag_cb(bContext *C, void *poin, void *poin2) bool do_isolate = (win->eventstate->ctrl != 0) && !do_disable; bool extend = (win->eventstate->shift != 0); bool depsgraph_changed = false; - const bool is_library = (ob->id.lib != NULL); + const bool is_linked = ID_IS_LINKED(ob); if (do_disable) { - if (!is_library) { + if (!is_linked) { ob->restrictflag |= OB_RESTRICT_VIEW; depsgraph_changed = true; } } else if (do_isolate) { - depsgraph_changed = (!is_library) && ((ob->restrictflag & OB_RESTRICT_VIEW) != 0); + depsgraph_changed = (!is_linked) && ((ob->restrictflag & OB_RESTRICT_VIEW) != 0); if (!extend) { /* Make only one base visible. */ @@ -300,12 +300,12 @@ static void hidebutton_base_flag_cb(bContext *C, void *poin, void *poin2) base->flag ^= BASE_HIDDEN; } - if (!is_library) { + if (!is_linked) { ob->restrictflag &= ~OB_RESTRICT_VIEW; } } else if (ob->restrictflag & OB_RESTRICT_VIEW) { - if (!is_library) { + if (!is_linked) { ob->restrictflag &= ~OB_RESTRICT_VIEW; base->flag &= ~BASE_HIDDEN; } @@ -342,7 +342,7 @@ static void hidebutton_layer_collection_flag_cb(bContext *C, void *poin, void *p bool depsgraph_changed = false; if (do_disable) { - if (collection->id.lib == NULL) { + if (!ID_IS_LINKED(collection)) { collection->flag |= COLLECTION_RESTRICT_VIEW; depsgraph_changed = true; } -- cgit v1.2.3