|
Blender V4.3
|
Utilities ensuring .blend file (i.e. Main) is in valid state during write and/or read process.
More...
Go to the source code of this file.
Functions | |
| bool | BLO_main_validate_libraries (Main *bmain, ReportList *reports) |
| bool | BLO_main_validate_shapekeys (Main *bmain, ReportList *reports) |
| void | BLO_main_validate_embedded_liboverrides (Main *bmain, ReportList *reports) |
| void | BLO_main_validate_embedded_flag (Main *bmain, ReportList *reports) |
Utilities ensuring .blend file (i.e. Main) is in valid state during write and/or read process.
Definition in file BLO_blend_validate.hh.
| void BLO_main_validate_embedded_flag | ( | Main * | bmain, |
| ReportList * | reports ) |
Check that the ID_FLAG_EMBEDDED_DATA flag is correctly set for embedded IDs, and not for any Main ID.
NOTE: It is unknown why/how this can happen, but there are some files out there that have e.g. Objects flagged as embedded data... See e.g. the (Anim) Hero p23 for 2.blend file from our cloud gallery (https://cloud.blender.org/p/gallery/5b642e25bf419c1042056fc6).
Definition at line 242 of file blend_validate.cc.
References CLOG_ERROR, ID::flag, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, ID_FLAG_EMBEDDED_DATA, ID_SCE, LOG, ID::name, node_tree, and blender::bke::node_tree_from_id().
Referenced by after_liblink_merged_bmain_process().
| void BLO_main_validate_embedded_liboverrides | ( | Main * | bmain, |
| ReportList * | reports ) |
Check that the ID_FLAG_EMBEDDED_DATA_LIB_OVERRIDE flag for embedded IDs actually matches reality of embedded IDs being used by a liboverride ID.
This is needed because embedded IDs did not get their flag properly cleared when runtime data was split in ID.tag, which can create crashing situations in some rare cases, see #117795.
Definition at line 217 of file blend_validate.cc.
References ID::flag, FOREACH_MAIN_ID_BEGIN, FOREACH_MAIN_ID_END, GS, Collection::id, ID_FLAG_EMBEDDED_DATA_LIB_OVERRIDE, ID_IS_OVERRIDE_LIBRARY, ID_SCE, Scene::master_collection, ID::name, node_tree, and blender::bke::node_tree_from_id().
Referenced by after_liblink_merged_bmain_process().
| bool BLO_main_validate_libraries | ( | Main * | bmain, |
| ReportList * | reports ) |
Check (but do not fix) that all linked data-blocks are still valid (i.e. pointing to the right library).
Definition at line 45 of file blend_validate.cc.
References BKE_library_filepath_set(), BKE_main_lock(), BKE_main_unlock(), BKE_report(), BKE_reportf(), BLI_assert, BLI_linklist_freeN(), BLI_listbase_is_single(), BLO_blendhandle_close(), BLO_blendhandle_from_file(), BLO_blendhandle_get_datablock_names(), blo_join_main(), blo_split_main(), Library::filepath, Library_Runtime::filepath_abs, ListBase::first, GS, Library::id, ID_IS_LINKED, ID_LI, INDEX_ID_MAX, is_valid, LinkNode::link, ID::name, Main::next, BlendFileReadReport::reports, RPT_ERROR, Library::runtime, set_listbasepointers(), and STREQ.
Referenced by ed_undo_step_post(), ed_undo_step_pre(), write_file_main_validate_post(), and write_file_main_validate_pre().
| bool BLO_main_validate_shapekeys | ( | Main * | bmain, |
| ReportList * | reports ) |
Definition at line 162 of file blend_validate.cc.
References BKE_id_delete_ex(), BKE_key_from_id(), BKE_key_idtype_support(), BKE_main_lock(), BKE_main_unlock(), BKE_reportf(), FOREACH_MAIN_LISTBASE_BEGIN, FOREACH_MAIN_LISTBASE_END, FOREACH_MAIN_LISTBASE_ID_BEGIN, FOREACH_MAIN_LISTBASE_ID_END, Key::from, GS, Key::id, ID_IS_LINKED, ID_REMAP_FORCE_UI_POINTERS, is_valid, LISTBASE_FOREACH_MUTABLE, ID::name, RPT_ERROR, and Main::shapekeys.
Referenced by after_liblink_merged_bmain_process(), and write_file_main_validate_pre().