BKE libquery: Add option to also process `ID.lib` pointer.

This was never needed before, but upcomming work for Brush Asset project
requires it.
This commit is contained in:
Bastien Montagne 2023-02-06 17:31:01 +01:00
parent 8fe4f3b756
commit 39e0bbfa55
2 changed files with 6 additions and 2 deletions

View File

@ -142,6 +142,9 @@ enum {
/** Also process internal ID pointers like `ID.newid` or `ID.orig_id`.
* WARNING: Dangerous, use with caution. */
IDWALK_DO_INTERNAL_RUNTIME_POINTERS = (1 << 9),
/** Also process the ID.lib pointer. It is an option because this pointer can usually be fully
ignored. */
IDWALK_DO_LIBRARY_POINTER = (1 << 10),
};
typedef struct LibraryForeachIDData LibraryForeachIDData;

View File

@ -294,8 +294,9 @@ static bool library_foreach_ID_link(Main *bmain,
continue;
}
/* NOTE: ID.lib pointer is purposefully fully ignored here...
* We may want to add it at some point? */
if (flag & IDWALK_DO_LIBRARY_POINTER) {
CALLBACK_INVOKE(id->lib, IDWALK_CB_NEVER_SELF);
}
if (flag & IDWALK_DO_INTERNAL_RUNTIME_POINTERS) {
CALLBACK_INVOKE_ID(id->newid, IDWALK_CB_INTERNAL);