Core: add BKE_lib_query_foreachid_process_main_get() function

Add a function to get the `Main *bmain` pointer from a
LibraryForeachIDData struct. Since the struct is opaque to the
`..._foreach_id` functions, a separate function like this is necessary
to get that pointer.

Not used yet, but will be in a followup commit.

Pull Request: https://projects.blender.org/blender/blender/pulls/123187
This commit is contained in:
Sybren A. Stüvel
2024-06-28 12:31:36 +02:00
parent d3aa4ecfe6
commit d342f64fa4
2 changed files with 6 additions and 0 deletions

View File

@@ -237,6 +237,7 @@ enum {
bool BKE_lib_query_foreachid_iter_stop(const LibraryForeachIDData *data);
void BKE_lib_query_foreachid_process(LibraryForeachIDData *data, ID **id_pp, int cb_flag);
int BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data);
Main *BKE_lib_query_foreachid_process_main_get(const LibraryForeachIDData *data);
int BKE_lib_query_foreachid_process_callback_flag_override(LibraryForeachIDData *data,
int cb_flag,
bool do_replace);

View File

@@ -122,6 +122,11 @@ int BKE_lib_query_foreachid_process_flags_get(const LibraryForeachIDData *data)
return data->flag;
}
Main *BKE_lib_query_foreachid_process_main_get(const LibraryForeachIDData *data)
{
return data->bmain;
}
int BKE_lib_query_foreachid_process_callback_flag_override(LibraryForeachIDData *data,
const int cb_flag,
const bool do_replace)