Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/library_query.c
| Show First 20 Lines • Show All 367 Lines • ▼ Show 20 Lines | void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback callback, void *user_data, int flag) | ||||
| data.user_data = user_data; | data.user_data = user_data; | ||||
| #define CALLBACK_INVOKE_ID(check_id, cb_flag) \ | #define CALLBACK_INVOKE_ID(check_id, cb_flag) \ | ||||
| FOREACH_CALLBACK_INVOKE_ID(&data, check_id, cb_flag) | FOREACH_CALLBACK_INVOKE_ID(&data, check_id, cb_flag) | ||||
| #define CALLBACK_INVOKE(check_id_super, cb_flag) \ | #define CALLBACK_INVOKE(check_id_super, cb_flag) \ | ||||
| FOREACH_CALLBACK_INVOKE(&data, check_id_super, cb_flag) | FOREACH_CALLBACK_INVOKE(&data, check_id_super, cb_flag) | ||||
| if (id->override_static != NULL) { | |||||
| CALLBACK_INVOKE_ID(id->override_static->reference, IDWALK_CB_USER | IDWALK_CB_STATIC_OVERRIDE_REFERENCE); | |||||
| } | |||||
| for (; id != NULL; id = (flag & IDWALK_RECURSE) ? BLI_LINKSTACK_POP(data.ids_todo) : NULL) { | for (; id != NULL; id = (flag & IDWALK_RECURSE) ? BLI_LINKSTACK_POP(data.ids_todo) : NULL) { | ||||
| data.self_id = id; | data.self_id = id; | ||||
| data.cb_flag = ID_IS_LINKED(id) ? IDWALK_CB_INDIRECT_USAGE : 0; | data.cb_flag = ID_IS_LINKED(id) ? IDWALK_CB_INDIRECT_USAGE : 0; | ||||
| if (bmain != NULL && bmain->relations != NULL && (flag & IDWALK_READONLY)) { | if (bmain != NULL && bmain->relations != NULL && (flag & IDWALK_READONLY)) { | ||||
| /* Note that this is minor optimization, even in worst cases (like id being an object with lots of | /* 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), | * 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, it's responsibility of code | * but we might as well use it (Main->relations is always assumed valid, it's responsibility of code | ||||
| ▲ Show 20 Lines • Show All 1,023 Lines • Show Last 20 Lines | |||||