Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/lib_query.c
| Show First 20 Lines • Show All 231 Lines • ▼ Show 20 Lines | for (; id != NULL; id = (flag & IDWALK_RECURSE) ? BLI_LINKSTACK_POP(data.ids_todo) : NULL) { | ||||
| if (bmain != NULL && bmain->relations != NULL && (flag & IDWALK_READONLY) && | if (bmain != NULL && bmain->relations != NULL && (flag & IDWALK_READONLY) && | ||||
| (((bmain->relations->flag & MAINIDRELATIONS_INCLUDE_UI) == 0) == | (((bmain->relations->flag & MAINIDRELATIONS_INCLUDE_UI) == 0) == | ||||
| ((data.flag & IDWALK_INCLUDE_UI) == 0))) { | ((data.flag & IDWALK_INCLUDE_UI) == 0))) { | ||||
| /* Note that this is minor optimization, even in worst cases (like id being an object with | /* Note that this is minor optimization, even in worst cases (like id being an object with | ||||
| * lots of drivers and constraints and modifiers, or material etc. with huge node tree), | * lots of drivers and constraints and modifiers, or material etc. with huge node tree), | ||||
| * but we might as well use it (Main->relations is always assumed valid, | * but we might as well use it (Main->relations is always assumed valid, | ||||
| * it's responsibility of code creating it to free it, | * it's responsibility of code creating it to free it, | ||||
| * especially if/when it starts modifying Main database). */ | * especially if/when it starts modifying Main database). */ | ||||
| MainIDRelationsEntry *entry = BLI_ghash_lookup(bmain->relations->id_user_to_used, id); | MainIDRelationsEntry *entry = BLI_ghash_lookup(bmain->relations->relations_from_pointers, | ||||
| for (; entry != NULL; entry = entry->next) { | id); | ||||
| BKE_lib_query_foreachid_process(&data, entry->id_pointer, entry->usage_flag); | for (MainIDRelationsEntryItem *to_id_entry = entry->to_ids; to_id_entry != NULL; | ||||
| to_id_entry = to_id_entry->next) { | |||||
| BKE_lib_query_foreachid_process( | |||||
| &data, to_id_entry->id_pointer.to, to_id_entry->usage_flag); | |||||
| } | } | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* Note: ID.lib pointer is purposefully fully ignored here... | /* Note: ID.lib pointer is purposefully fully ignored here... | ||||
| * We may want to add it at some point? */ | * We may want to add it at some point? */ | ||||
| if (id->override_library != NULL) { | if (id->override_library != NULL) { | ||||
| ▲ Show 20 Lines • Show All 439 Lines • Show Last 20 Lines | |||||