diff options
author | Bastien Montagne <bastien@blender.org> | 2021-08-26 16:01:14 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-08-26 16:01:14 +0300 |
commit | edb95b3fcbb907fe4b93fecf9e398f41113b3ee4 (patch) | |
tree | 0f39a4b935d29a170ecaa887496a0a0ef4cae72a /source/blender | |
parent | 1bb2077250aed65e9445468161e01aa219a89624 (diff) |
Cleanup: Use `ID_IS_LINKED` instead of direct `id.lib` pointer check.
Diffstat (limited to 'source/blender')
25 files changed, 43 insertions, 44 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 981815f400a..16d269f9e26 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1991,7 +1991,7 @@ void BKE_pose_blend_read_lib(BlendLibReader *reader, Object *ob, bPose *pose) if (UNLIKELY(pchan->bone == NULL)) { rebuild = true; } - else if ((ob->id.lib == NULL) && arm->id.lib) { + else if (!ID_IS_LINKED(ob) && ID_IS_LINKED(arm)) { /* local pose selection copied to armature, bit hackish */ pchan->bone->flag &= ~BONE_SELECTED; pchan->bone->flag |= pchan->selectflag; diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 30aa22387d0..72f14d94833 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -6657,7 +6657,7 @@ void BKE_constraint_blend_read_lib(BlendLibReader *reader, ID *id, ListBase *con BLO_read_id_address(reader, id->lib, &con->ipo); /* XXX deprecated - old animation system */ /* If linking from a library, clear 'local' library override flag. */ - if (id->lib != NULL) { + if (ID_IS_LINKED(id)) { con->flag &= ~CONSTRAINT_OVERRIDE_LIBRARY_LOCAL; } } diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 9062fd2d39c..a143645c2ee 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -208,7 +208,7 @@ void BKE_gpencil_blend_read_data(BlendDataReader *reader, bGPdata *gpd) BKE_animdata_blend_read_data(reader, gpd->adt); /* Ensure full objectmode for linked grease pencil. */ - if (gpd->id.lib != NULL) { + if (ID_IS_LINKED(gpd)) { gpd->flag &= ~GP_DATA_STROKE_PAINTMODE; gpd->flag &= ~GP_DATA_STROKE_EDITMODE; gpd->flag &= ~GP_DATA_STROKE_SCULPTMODE; diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c index 4db527e5b42..eac6a05d33a 100644 --- a/source/blender/blenkernel/intern/gpencil_modifier.c +++ b/source/blender/blenkernel/intern/gpencil_modifier.c @@ -1025,7 +1025,7 @@ void BKE_gpencil_modifier_blend_read_lib(BlendLibReader *reader, Object *ob) BKE_gpencil_modifiers_foreach_ID_link(ob, BKE_object_modifiers_lib_link_common, reader); /* If linking from a library, clear 'local' library override flag. */ - if (ob->id.lib != NULL) { + if (ID_IS_LINKED(ob)) { LISTBASE_FOREACH (GpencilModifierData *, mod, &ob->greasepencil_modifiers) { mod->flag &= ~eGpencilModifierFlag_OverrideLibrary_Local; } diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c index aa458bc1b27..11e9053df43 100644 --- a/source/blender/blenkernel/intern/lib_id.c +++ b/source/blender/blenkernel/intern/lib_id.c @@ -970,7 +970,7 @@ void BKE_main_id_repair_duplicate_names_listbase(ListBase *lb) { int lb_len = 0; LISTBASE_FOREACH (ID *, id, lb) { - if (id->lib == NULL) { + if (!ID_IS_LINKED(id)) { lb_len += 1; } } @@ -983,7 +983,7 @@ void BKE_main_id_repair_duplicate_names_listbase(ListBase *lb) GSet *gset = BLI_gset_str_new_ex(__func__, lb_len); int i = 0; LISTBASE_FOREACH (ID *, id, lb) { - if (id->lib == NULL) { + if (!ID_IS_LINKED(id)) { id_array[i] = id; i++; } @@ -1840,7 +1840,7 @@ static void library_make_local_copying_check(ID *id, from_id = ((Key *)from_id)->from; } - if (from_id->lib == NULL) { + if (!ID_IS_LINKED(from_id)) { /* Local user, early out to avoid some gset querying... */ continue; } @@ -2068,7 +2068,7 @@ void BKE_library_make_local(Main *bmain, ID *id = it->link; BLI_assert(id->newid != NULL); - BLI_assert(id->lib != NULL); + BLI_assert(ID_IS_LINKED(id)); BKE_libblock_remap(bmain, id, id->newid, ID_REMAP_SKIP_INDIRECT_USAGE); if (old_to_new_ids) { @@ -2103,7 +2103,7 @@ void BKE_library_make_local(Main *bmain, bool is_local = false, is_lib = false; /* Proxies only work when the proxified object is linked-in from a library. */ - if (ob->proxy->id.lib == NULL) { + if (!ID_IS_LINKED(ob->proxy)) { CLOG_WARN(&LOG, "proxy object %s will lose its link to %s, because the " "proxified object is local.", @@ -2221,7 +2221,7 @@ void BKE_id_full_name_get(char name[MAX_ID_FULL_NAME], const ID *id, char separa { strcpy(name, id->name + 2); - if (id->lib != NULL) { + if (ID_IS_LINKED(id)) { const size_t idname_len = strlen(id->name + 2); const size_t libname_len = strlen(id->lib->id.name + 2); @@ -2274,7 +2274,7 @@ void BKE_id_full_name_ui_prefix_get(char name[MAX_ID_FULL_NAME_UI], */ char *BKE_id_to_unique_string_key(const struct ID *id) { - if (id->lib == NULL) { + if (!ID_IS_LINKED(id)) { return BLI_strdup(id->name); } diff --git a/source/blender/blenkernel/intern/lib_id_delete.c b/source/blender/blenkernel/intern/lib_id_delete.c index 43afac5a376..79717fe5f48 100644 --- a/source/blender/blenkernel/intern/lib_id_delete.c +++ b/source/blender/blenkernel/intern/lib_id_delete.c @@ -219,7 +219,7 @@ void BKE_id_free_us(Main *bmain, void *idv) /* test users */ * Otherwise, there is no real way to get rid of an object anymore - * better handling of this is TODO. */ - if ((GS(id->name) == ID_OB) && (id->us == 1) && (id->lib == NULL)) { + if ((GS(id->name) == ID_OB) && (id->us == 1) && !ID_IS_LINKED(id)) { id_us_clear_real(id); } diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 8083585b594..8c1e04838df 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -104,7 +104,7 @@ IDOverrideLibrary *BKE_lib_override_library_init(ID *local_id, ID *reference_id) { /* If reference_id is NULL, we are creating an override template for purely local data. * Else, reference *must* be linked data. */ - BLI_assert(reference_id == NULL || reference_id->lib != NULL); + BLI_assert(reference_id == NULL || ID_IS_LINKED(reference_id)); BLI_assert(local_id->override_library == NULL); ID *ancestor_id; @@ -286,7 +286,7 @@ ID *BKE_lib_override_library_create_from_id(Main *bmain, const bool do_tagged_remap) { BLI_assert(reference_id != NULL); - BLI_assert(reference_id->lib != NULL); + BLI_assert(ID_IS_LINKED(reference_id)); ID *local_id = lib_override_library_create_from(bmain, reference_id, 0); @@ -299,7 +299,7 @@ ID *BKE_lib_override_library_create_from_id(Main *bmain, ID *other_id; FOREACH_MAIN_ID_BEGIN (bmain, other_id) { - if ((other_id->tag & LIB_TAG_DOIT) != 0 && other_id->lib == NULL) { + if ((other_id->tag & LIB_TAG_DOIT) != 0 && !ID_IS_LINKED(other_id)) { /* Note that using ID_REMAP_SKIP_INDIRECT_USAGE below is superfluous, as we only remap * local IDs usages anyway. */ BKE_libblock_relink_ex(bmain, @@ -830,7 +830,7 @@ static void lib_override_library_create_post_process(Main *bmain, Collection *default_instantiating_collection = residual_storage; LISTBASE_FOREACH (Object *, ob, &bmain->objects) { Object *ob_new = (Object *)ob->id.newid; - if (ob_new == NULL || ob_new->id.lib != NULL) { + if (ob_new == NULL || ID_IS_LINKED(ob_new)) { continue; } @@ -1148,7 +1148,7 @@ bool BKE_lib_override_library_resync(Main *bmain, /* We need to 'move back' newly created override into its proper library (since it was * duplicated from the reference ID with 'no main' option, it should currently be the same * as the reference ID one). */ - BLI_assert(/*id_override_new->lib == NULL || */ id_override_new->lib == id->lib); + BLI_assert(/*!ID_IS_LINKED(id_override_new) || */ id_override_new->lib == id->lib); BLI_assert(id_override_old == NULL || id_override_old->lib == id_root->lib); id_override_new->lib = id_root->lib; /* Remap step below will tag directly linked ones properly as needed. */ @@ -1734,8 +1734,7 @@ void BKE_lib_override_library_main_resync(Main *bmain, #define OVERRIDE_RESYNC_RESIDUAL_STORAGE_NAME "OVERRIDE_RESYNC_LEFTOVERS" Collection *override_resync_residual_storage = BLI_findstring( &bmain->collections, OVERRIDE_RESYNC_RESIDUAL_STORAGE_NAME, offsetof(ID, name) + 2); - if (override_resync_residual_storage != NULL && - override_resync_residual_storage->id.lib != NULL) { + if (override_resync_residual_storage != NULL && ID_IS_LINKED(override_resync_residual_storage)) { override_resync_residual_storage = NULL; } if (override_resync_residual_storage == NULL) { @@ -2195,7 +2194,7 @@ void BKE_lib_override_library_validate(Main *UNUSED(bmain), ID *id, ReportList * id->override_library->reference = NULL; return; } - if (id->override_library->reference->lib == NULL) { + if (!ID_IS_LINKED(id->override_library->reference)) { /* Very serious data corruption, cannot do much about it besides removing the reference * (therefore making the id a local override template one only). */ BKE_reportf(reports, diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c index 9400458376d..36cbf35b251 100644 --- a/source/blender/blenkernel/intern/lib_query.c +++ b/source/blender/blenkernel/intern/lib_query.c @@ -845,7 +845,7 @@ void BKE_library_indirectly_used_data_tag_clear(Main *bmain) while (i--) { LISTBASE_FOREACH (ID *, id, lb_array[i]) { - if (id->lib == NULL || id->tag & LIB_TAG_DOIT) { + if (!ID_IS_LINKED(id) || id->tag & LIB_TAG_DOIT) { /* Local or non-indirectly-used ID (so far), no need to check it further. */ continue; } diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 821ca7b98b3..b328a31cda5 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -1573,7 +1573,7 @@ void BKE_modifier_blend_read_lib(BlendLibReader *reader, Object *ob) BKE_modifiers_foreach_ID_link(ob, BKE_object_modifiers_lib_link_common, reader); /* If linking from a library, clear 'local' library override flag. */ - if (ob->id.lib != NULL) { + if (ID_IS_LINKED(ob)) { LISTBASE_FOREACH (ModifierData *, mod, &ob->modifiers) { mod->flag &= ~eModifierFlag_OverrideLibrary_Local; } diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 7ea0d991f4c..4ce2ae3c11f 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -2344,7 +2344,7 @@ void BKE_nla_blend_read_lib(BlendLibReader *reader, ID *id, ListBase *tracks) /* we only care about the NLA strips inside the tracks */ LISTBASE_FOREACH (NlaTrack *, nlt, tracks) { /* If linking from a library, clear 'local' library override flag. */ - if (id->lib != NULL) { + if (ID_IS_LINKED(id)) { nlt->flag &= ~NLATRACK_OVERRIDELIBRARY_LOCAL; } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 6e26ed4925d..c91cf6ed926 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -864,7 +864,7 @@ static void object_blend_read_lib(BlendLibReader *reader, ID *id) BLO_read_id_address(reader, ob->id.lib, &ob->proxy); if (ob->proxy) { /* paranoia check, actually a proxy_from pointer should never be written... */ - if (ob->proxy->id.lib == NULL) { + if (!ID_IS_LINKED(ob->proxy)) { ob->proxy->proxy_from = NULL; ob->proxy = NULL; diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index de82f0832d8..6b5c94a2786 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -3356,7 +3356,7 @@ static char *scene_undo_depsgraph_gen_key(Scene *scene, ViewLayer *view_layer, c } size_t key_full_offset = BLI_strncpy_rlen(key_full, scene->id.name, MAX_ID_NAME); - if (scene->id.lib != NULL) { + if (ID_IS_LINKED(scene)) { key_full_offset += BLI_strncpy_rlen( key_full + key_full_offset, scene->id.lib->filepath, FILE_MAX); } diff --git a/source/blender/blenkernel/intern/shader_fx.c b/source/blender/blenkernel/intern/shader_fx.c index 29cbe05f4d1..12017907038 100644 --- a/source/blender/blenkernel/intern/shader_fx.c +++ b/source/blender/blenkernel/intern/shader_fx.c @@ -326,7 +326,7 @@ void BKE_shaderfx_blend_read_lib(BlendLibReader *reader, Object *ob) BKE_shaderfx_foreach_ID_link(ob, BKE_object_modifiers_lib_link_common, reader); /* If linking from a library, clear 'local' library override flag. */ - if (ob->id.lib != NULL) { + if (ID_IS_LINKED(ob)) { LISTBASE_FOREACH (ShaderFxData *, fx, &ob->shader_fx) { fx->flag &= ~eShaderFxFlag_OverrideLibrary_Local; } diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c index e524bd254bb..0ca2b97b4ef 100644 --- a/source/blender/blenkernel/intern/undo_system.c +++ b/source/blender/blenkernel/intern/undo_system.c @@ -145,7 +145,7 @@ static void undosys_id_ref_resolve(void *user_data, UndoRefID *id_ref) Main *bmain = user_data; ListBase *lb = which_libbase(bmain, GS(id_ref->name)); LISTBASE_FOREACH (ID *, id, lb) { - if (STREQ(id_ref->name, id->name) && (id->lib == NULL)) { + if (STREQ(id_ref->name, id->name) && !ID_IS_LINKED(id)) { id_ref->ptr = id; break; } diff --git a/source/blender/blenloader/intern/blend_validate.c b/source/blender/blenloader/intern/blend_validate.c index 5b093223fda..7d641d976e3 100644 --- a/source/blender/blenloader/intern/blend_validate.c +++ b/source/blender/blenloader/intern/blend_validate.c @@ -64,7 +64,7 @@ bool BLO_main_validate_libraries(Main *bmain, ReportList *reports) int i = set_listbasepointers(bmain, lbarray); while (i--) { for (ID *id = lbarray[i]->first; id != NULL; id = id->next) { - if (id->lib != NULL) { + if (ID_IS_LINKED(id)) { is_valid = false; BKE_reportf(reports, RPT_ERROR, @@ -115,7 +115,7 @@ bool BLO_main_validate_libraries(Main *bmain, ReportList *reports) int totnames = 0; LinkNode *names = BLO_blendhandle_get_datablock_names(bh, GS(id->name), false, &totnames); for (; id != NULL; id = id->next) { - if (id->lib == NULL) { + if (!ID_IS_LINKED(id)) { is_valid = false; BKE_reportf(reports, RPT_ERROR, @@ -179,7 +179,7 @@ bool BLO_main_validate_shapekeys(Main *bmain, ReportList *reports) if (!BKE_key_idtype_support(GS(id->name))) { break; } - if (id->lib == NULL) { + if (!ID_IS_LINKED(id)) { /* We assume lib data is valid... */ Key *shapekey = BKE_key_from_id(id); if (shapekey != NULL && shapekey->from != id) { diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 2ee66206878..3e9ea8db758 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1625,7 +1625,7 @@ static void change_link_placeholder_to_real_ID_pointer(ListBase *mainlist, void blo_clear_proxy_pointers_from_lib(Main *oldmain) { LISTBASE_FOREACH (Object *, ob, &oldmain->objects) { - if (ob->id.lib != NULL && ob->proxy_from != NULL && ob->proxy_from->id.lib == NULL) { + if (ID_IS_LINKED(ob) && ob->proxy_from != NULL && !ID_IS_LINKED(ob->proxy_from)) { ob->proxy_from = NULL; } } diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index f77d0361e51..2598c53a5e0 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -444,7 +444,7 @@ static void do_version_layers_to_collections(Main *bmain, Scene *scene) Collection *collection = BKE_collection_add(bmain, collection_master, name); collection->id.lib = scene->id.lib; - if (collection->id.lib != NULL) { + if (ID_IS_LINKED(collection)) { collection->id.tag |= LIB_TAG_INDIRECT; } collections[layer] = collection; @@ -574,10 +574,10 @@ static void do_version_layers_to_collections(Main *bmain, Scene *scene) static void do_version_collection_propagate_lib_to_children(Collection *collection) { - if (collection->id.lib != NULL) { + if (ID_IS_LINKED(collection)) { for (CollectionChild *collection_child = collection->children.first; collection_child != NULL; collection_child = collection_child->next) { - if (collection_child->collection->id.lib == NULL) { + if (!ID_IS_LINKED(collection_child->collection)) { collection_child->collection->id.lib = collection->id.lib; } do_version_collection_propagate_lib_to_children(collection_child->collection); diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 90d58514eb5..56ff7151cb1 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -840,7 +840,7 @@ static void write_renderinfo(WriteData *wd, Main *mainvar) current_screen_compat(mainvar, false, &curscreen, &curscene, &view_layer); LISTBASE_FOREACH (Scene *, sce, &mainvar->scenes) { - if (sce->id.lib == NULL && (sce == curscene || (sce->r.scemode & R_BG_RENDER))) { + if (!ID_IS_LINKED(sce) && (sce == curscene || (sce->r.scemode & R_BG_RENDER))) { RenderInfo data; data.sfra = sce->r.sfra; data.efra = sce->r.efra; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 0e5a6a79137..08d78552710 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -397,7 +397,7 @@ static bool id_search_add(const bContext *C, TemplateID *template_ui, uiSearchIt char name_ui[MAX_ID_FULL_NAME_UI]; int iconid = ui_id_icon_get(C, id, template_ui->preview); const bool use_lib_prefix = template_ui->preview || iconid; - const bool has_sep_char = (id->lib != NULL); + const bool has_sep_char = ID_IS_LINKED(id); /* When using previews, the library hint (linked, overridden, missing) is added with a * character prefix, otherwise we can use a icon. */ @@ -1112,7 +1112,7 @@ static void template_ID(const bContext *C, UI_but_flag_enable(but, UI_BUT_REDALERT); } - if (id->lib == NULL && !(ELEM(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_OB, ID_WS)) && + if (!ID_IS_LINKED(id) && !(ELEM(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_OB, ID_WS)) && (hide_buttons == false)) { uiDefIconButR(block, UI_BTYPE_ICON_TOGGLE, diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 93a790b53d0..1a41dc8e9fb 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -535,7 +535,7 @@ void ui_rna_collection_search_update_fn(const struct bContext *C, BLI_STATIC_ASSERT(sizeof(name_buf) >= MAX_ID_FULL_NAME_UI, "Name string buffer should be big enough to hold full UI ID name"); name = name_buf; - has_sep_char = (id->lib != NULL); + has_sep_char = ID_IS_LINKED(id); } } else { diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 1a53d25ad39..c7d23943b6c 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -3055,7 +3055,7 @@ static void filelist_readjob_main_recursive(Main *bmain, FileList *filelist) ok = 1; if (ok) { if (!(filelist->filter_data.flags & FLF_HIDE_DOT) || id->name[2] != '.') { - if (id->lib == NULL) { + if (!ID_IS_LINKED(id)) { files->entry->relpath = BLI_strdup(id->name + 2); } else { diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 4f8feda3911..11efd3e33ef 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -2338,7 +2338,7 @@ int ED_image_save_all_modified_info(const Main *bmain, ReportList *reports) if (image_should_be_saved(ima, &is_format_writable)) { if (BKE_image_has_packedfile(ima) || (ima->source == IMA_SRC_GENERATED)) { - if (ima->id.lib == NULL) { + if (!ID_IS_LINKED(ima)) { num_saveable_images++; } else { diff --git a/source/blender/editors/space_view3d/view3d_gizmo_camera.c b/source/blender/editors/space_view3d/view3d_gizmo_camera.c index e1d439bef15..30b9839935f 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_camera.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_camera.c @@ -75,7 +75,7 @@ static bool WIDGETGROUP_camera_poll(const bContext *C, wmGizmoGroupType *UNUSED( if (ob->type == OB_CAMERA) { Camera *camera = ob->data; /* TODO: support overrides. */ - if (camera->id.lib == NULL) { + if (!ID_IS_LINKED(camera)) { return true; } } @@ -408,7 +408,7 @@ static bool WIDGETGROUP_camera_view_poll(const bContext *C, wmGizmoGroupType *UN if (rv3d->persp == RV3D_CAMOB) { if (scene->r.mode & R_BORDER) { /* TODO: support overrides. */ - if (scene->id.lib == NULL) { + if (!ID_IS_LINKED(scene)) { return true; } } diff --git a/source/blender/editors/undo/memfile_undo.c b/source/blender/editors/undo/memfile_undo.c index 7c6ce56eab0..1bdc2b2251e 100644 --- a/source/blender/editors/undo/memfile_undo.c +++ b/source/blender/editors/undo/memfile_undo.c @@ -116,7 +116,7 @@ static int memfile_undosys_step_id_reused_cb(LibraryIDLinkCallbackData *cb_data) BLI_assert((id_self->tag & LIB_TAG_UNDO_OLD_ID_REUSED) != 0); ID *id = *id_pointer; - if (id != NULL && id->lib == NULL && (id->tag & LIB_TAG_UNDO_OLD_ID_REUSED) == 0) { + if (id != NULL && !ID_IS_LINKED(id) && (id->tag & LIB_TAG_UNDO_OLD_ID_REUSED) == 0) { bool do_stop_iter = true; if (GS(id_self->name) == ID_OB) { Object *ob_self = (Object *)id_self; diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index c838032f1bb..8fa2d0ed849 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -6151,7 +6151,7 @@ char *RNA_path_full_ID_py(Main *bmain, ID *id) } char lib_filepath_esc[(sizeof(id->lib->filepath) * 2) + 4]; - if (id->lib != NULL) { + if (ID_IS_LINKED(id)) { int ofs = 0; memcpy(lib_filepath_esc, ", \"", 3); ofs += 3; |