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/editors/animation | |
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/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 2 | ||||
-rw-r--r-- | source/blender/editors/animation/keyframes_draw.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 910e195173c..0a1a4787eb0 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1255,7 +1255,7 @@ static size_t animfilter_action(bAnimContext *ac, ListBase *anim_data, bDopeShee /* don't include anything from this action if it is linked in from another file, * and we're getting stuff for editing... */ - if ((filter_mode & ANIMFILTER_FOREDIT) && (act->id.lib)) + if ((filter_mode & ANIMFILTER_FOREDIT) && ID_IS_LINKED_DATABLOCK(act)) return 0; /* do groups */ 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); |