Commit: 66c23ea2b4a4eb66490a8b9b6c57ed60ec934a42
Author: Dalai Felinto
Date:   Sat Feb 9 18:41:52 2019 -0200
Branches: master
https://developer.blender.org/rB66c23ea2b4a4eb66490a8b9b6c57ed60ec934a42

Cleanup: Use ID_IS_LINKED instead of id.lib

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

M       source/blender/blenkernel/intern/layer.c
M       source/blender/editors/space_outliner/outliner_collections.c
M       source/blender/editors/space_outliner/outliner_draw.c

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

diff --git a/source/blender/blenkernel/intern/layer.c 
b/source/blender/blenkernel/intern/layer.c
index d660e5e6424..b7073045d6c 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -1005,7 +1005,7 @@ bool BKE_layer_collection_isolate(Scene *scene, ViewLayer 
*view_layer, LayerColl
        bool depsgraph_need_update = false;
        LayerCollection *lc_master = view_layer->layer_collections.first;
 
-       if (lc->collection->id.lib == NULL) {
+       if (!ID_IS_LINKED(lc->collection)) {
                if (lc->collection->flag & COLLECTION_RESTRICT_VIEW) {
                        lc->collection->flag &= ~COLLECTION_RESTRICT_VIEW;
                        depsgraph_need_update = true;
@@ -1029,7 +1029,7 @@ bool BKE_layer_collection_isolate(Scene *scene, ViewLayer 
*view_layer, LayerColl
        }
 
        while (lc_parent != lc) {
-               if (lc_parent->collection->id.lib == NULL) {
+               if (!ID_IS_LINKED(lc_parent->collection)) {
                        if (lc_parent->collection->flag & 
COLLECTION_RESTRICT_VIEW) {
                                lc_parent->collection->flag &= 
~COLLECTION_RESTRICT_VIEW;
                                depsgraph_need_update = true;
@@ -1089,7 +1089,7 @@ bool BKE_layer_collection_set_visible(ViewLayer 
*view_layer, LayerCollection *lc
        bool depsgraph_changed = false;
 
        if (visible &&
-           (lc->collection->id.lib == NULL) &&
+           (!ID_IS_LINKED(lc->collection)) &&
            ((lc->collection->flag & COLLECTION_RESTRICT_VIEW) != 0))
        {
                lc->collection->flag &= ~COLLECTION_RESTRICT_VIEW;
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;
                }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to