Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2016-07-06 15:11:01 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-07-06 15:11:01 +0300
commitd2312602125a452e6562a76ab91779943c67396d (patch)
treeda74fa2bce05d94d6bc800021d837b494e6936d7 /source/blender/editors/physics
parentb98b331d04fe3a335cc0656809b4b09196507500 (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/editors/physics')
-rw-r--r--source/blender/editors/physics/particle_edit.c2
-rw-r--r--source/blender/editors/physics/particle_object.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 30c102b70c5..e22a145b3a6 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -4693,7 +4693,7 @@ static int particle_edit_toggle_poll(bContext *C)
if (ob == NULL || ob->type != OB_MESH)
return 0;
- if (!ob->data || ((ID *)ob->data)->lib)
+ if (!ob->data || ID_IS_LINKED_DATABLOCK(ob->data))
return 0;
if (CTX_data_edit_object(C))
return 0;
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index 1297133e1a2..d6c89b9c7a5 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -974,7 +974,7 @@ static void remove_particle_systems_from_object(Object *ob_to)
if (ob_to->type != OB_MESH)
return;
- if (!ob_to->data || ((ID *)ob_to->data)->lib)
+ if (!ob_to->data || ID_IS_LINKED_DATABLOCK(ob_to->data))
return;
for (md = ob_to->modifiers.first; md; md = md_next) {
@@ -1004,7 +1004,7 @@ static bool copy_particle_systems_to_object(Scene *scene, Object *ob_from, Parti
if (ob_to->type != OB_MESH)
return false;
- if (!ob_to->data || ((ID *)ob_to->data)->lib)
+ if (!ob_to->data || ID_IS_LINKED_DATABLOCK(ob_to->data))
return false;
/* For remapping we need a valid DM.