diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-06 15:11:01 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-07-06 15:11:01 +0300 |
commit | d2312602125a452e6562a76ab91779943c67396d (patch) | |
tree | da74fa2bce05d94d6bc800021d837b494e6936d7 /source/blender/blenkernel/intern/particle.c | |
parent | b98b331d04fe3a335cc0656809b4b09196507500 (diff) |
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
Diffstat (limited to 'source/blender/blenkernel/intern/particle.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index d1f5afa26a6..4136f866f6a 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3332,7 +3332,7 @@ ParticleSettings *BKE_particlesettings_copy(ParticleSettings *part) BLI_duplicatelist(&partn->dupliweights, &part->dupliweights); - if (part->id.lib) { + if (ID_IS_LINKED_DATABLOCK(part)) { BKE_id_lib_local_paths(G.main, part->id.lib, &partn->id); } @@ -3360,7 +3360,7 @@ void BKE_particlesettings_make_local(ParticleSettings *part) * - mixed: make copy */ - if (part->id.lib == 0) return; + if (!ID_IS_LINKED_DATABLOCK(part)) return; if (part->id.us == 1) { id_clear_lib_data(bmain, &part->id); expand_local_particlesettings(part); @@ -3372,7 +3372,7 @@ void BKE_particlesettings_make_local(ParticleSettings *part) ParticleSystem *psys = ob->particlesystem.first; for (; psys; psys = psys->next) { if (psys->part == part) { - if (ob->id.lib) is_lib = true; + if (ID_IS_LINKED_DATABLOCK(ob)) is_lib = true; else is_local = true; } } @@ -3393,7 +3393,7 @@ void BKE_particlesettings_make_local(ParticleSettings *part) for (ob = bmain->object.first; ob; ob = ob->id.next) { ParticleSystem *psys; for (psys = ob->particlesystem.first; psys; psys = psys->next) { - if (psys->part == part && ob->id.lib == 0) { + if (psys->part == part && !ID_IS_LINKED_DATABLOCK(ob)) { psys->part = part_new; id_us_plus(&part_new->id); id_us_min(&part->id); |