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/editors/animation/keyframes_draw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/animation/keyframes_draw.c') diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 6f1883cff55..011a25ca219 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -679,7 +679,7 @@ void draw_fcurve_channel(View2D *v2d, AnimData *adt, FCurve *fcu, float ypos) short locked = (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) || - ((adt && adt->action) && (adt->action->id.lib)); + ((adt && adt->action) && ID_IS_LINKED_DATABLOCK(adt->action)); BLI_dlrbTree_init(&keys); BLI_dlrbTree_init(&blocks); @@ -700,7 +700,7 @@ void draw_agroup_channel(View2D *v2d, AnimData *adt, bActionGroup *agrp, float y DLRBT_Tree keys, blocks; short locked = (agrp->flag & AGRP_PROTECTED) || - ((adt && adt->action) && (adt->action->id.lib)); + ((adt && adt->action) && ID_IS_LINKED_DATABLOCK(adt->action)); BLI_dlrbTree_init(&keys); BLI_dlrbTree_init(&blocks); @@ -720,7 +720,7 @@ void draw_action_channel(View2D *v2d, AnimData *adt, bAction *act, float ypos) { DLRBT_Tree keys, blocks; - short locked = (act && act->id.lib != NULL); + short locked = (act && ID_IS_LINKED_DATABLOCK(act)); BLI_dlrbTree_init(&keys); BLI_dlrbTree_init(&blocks); -- cgit v1.2.3