From d2312602125a452e6562a76ab91779943c67396d Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 6 Jul 2016 14:11:01 +0200 Subject: Replace of (id->lib != NULL) check by meaningful macro. Idea is to replace hard-to-track (id->lib != NULL) 'is linked datablock' check everywhere in Blender by a macro doing the same thing. This will allow to easily spot those checks in future, and more importantly, to easily change it (see work done in asset-engine branch). Note: did not touch to readfile.c, since there most of the time 'id->lib' check actually concerns the pointer, and not a check whether ID is linked or not. Will have a closer look at it later. Reviewers: campbellbarton, brecht, sergey Differential Revision: https://developer.blender.org/D2082 --- source/blender/blenkernel/intern/mball.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/mball.c') diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 685cd35fc20..877937eb726 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -117,7 +117,7 @@ MetaBall *BKE_mball_copy(MetaBall *mb) mbn->editelems = NULL; mbn->lastelem = NULL; - if (mb->id.lib) { + if (ID_IS_LINKED_DATABLOCK(mb)) { BKE_id_lib_local_paths(G.main, mb->id.lib, &mbn->id); } @@ -142,7 +142,7 @@ void BKE_mball_make_local(MetaBall *mb) * - mixed: make copy */ - if (mb->id.lib == NULL) return; + if (!ID_IS_LINKED_DATABLOCK(mb)) return; if (mb->id.us == 1) { id_clear_lib_data(bmain, &mb->id); extern_local_mball(mb); @@ -152,7 +152,7 @@ void BKE_mball_make_local(MetaBall *mb) for (ob = G.main->object.first; ob && ELEM(0, is_lib, is_local); ob = ob->id.next) { if (ob->data == mb) { - if (ob->id.lib) is_lib = true; + if (ID_IS_LINKED_DATABLOCK(ob)) is_lib = true; else is_local = true; } } @@ -170,7 +170,7 @@ void BKE_mball_make_local(MetaBall *mb) for (ob = G.main->object.first; ob; ob = ob->id.next) { if (ob->data == mb) { - if (ob->id.lib == NULL) { + if (!ID_IS_LINKED_DATABLOCK(ob)) { ob->data = mb_new; id_us_plus(&mb_new->id); id_us_min(&mb->id); -- cgit v1.2.3