Blender V4.3
blend_validate.cc File Reference
#include <cstring>
#include "CLG_log.h"
#include "BLI_utildefines.h"
#include "BLI_linklist.h"
#include "MEM_guardedalloc.h"
#include "DNA_collection_types.h"
#include "DNA_key_types.h"
#include "DNA_node_types.h"
#include "DNA_sdna_types.h"
#include "DNA_windowmanager_types.h"
#include "BKE_key.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_remap.hh"
#include "BKE_library.hh"
#include "BKE_main.hh"
#include "BKE_node.hh"
#include "BKE_report.hh"
#include "BLO_blend_validate.hh"
#include "BLO_readfile.hh"
#include "readfile.hh"

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 *)
 
void BLO_main_validate_embedded_flag (Main *bmain, ReportList *)
 

Variables

static CLG_LogRef LOG = {"blo.blend_validate"}
 

Detailed Description

Utils to check/validate a Main is in sane state, only checks relations between data-blocks and libraries for now.

Note
Does not fix anything, only reports found errors.

Definition in file blend_validate.cc.

Function Documentation

◆ BLO_main_validate_embedded_flag()

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().

◆ BLO_main_validate_embedded_liboverrides()

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().

◆ BLO_main_validate_libraries()

◆ BLO_main_validate_shapekeys()

Variable Documentation

◆ LOG

CLG_LogRef LOG = {"blo.blend_validate"}
static

Definition at line 43 of file blend_validate.cc.

Referenced by BLO_main_validate_embedded_flag().