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/armature/pose_edit.c | 2 +- source/blender/editors/armature/pose_lib.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/armature') diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index a929507929f..5015829f868 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -86,7 +86,7 @@ void ED_armature_enter_posemode(bContext *C, Base *base) ReportList *reports = CTX_wm_reports(C); Object *ob = base->object; - if (ob->id.lib) { + if (ID_IS_LINKED_DATABLOCK(ob)) { BKE_report(reports, RPT_WARNING, "Cannot pose libdata"); return; } diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c index dca9aa3e446..d9a3efa765c 100644 --- a/source/blender/editors/armature/pose_lib.c +++ b/source/blender/editors/armature/pose_lib.c @@ -183,7 +183,7 @@ static int has_poselib_pose_data_poll(bContext *C) static int has_poselib_pose_data_for_editing_poll(bContext *C) { Object *ob = get_poselib_object(C); - return (ob && ob->poselib && !ob->poselib->id.lib); + return (ob && ob->poselib && !ID_IS_LINKED_DATABLOCK(ob->poselib)); } /* ----------------------------------- */ @@ -385,7 +385,7 @@ static int poselib_add_poll(bContext *C) if (ED_operator_posemode(C)) { Object *ob = get_poselib_object(C); if (ob) { - if ((ob->poselib == NULL) || (ob->poselib->id.lib == 0)) { + if ((ob->poselib == NULL) || !ID_IS_LINKED_DATABLOCK(ob->poselib)) { return true; } } -- cgit v1.2.3