Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/library_query.c
| Context not available. | |||||
| FOREACH_FINALIZE_VOID; | FOREACH_FINALIZE_VOID; | ||||
| } | } | ||||
| static void library_foreach_ID_as_subdata_link( | |||||
| ID *id, LibraryIDLinkCallback callback, void *user_data, int flag, LibraryForeachIDData *data) | |||||
| { | |||||
| if (flag & IDWALK_RECURSE) { | |||||
| /* Defer handling into main loop, recursively calling BKE_library_foreach_ID_link in IDWALK_RECURSE case is | |||||
| * troublesome, see T49553. */ | |||||
| if (!BLI_gset_haskey(data->ids_handled, id)) { | |||||
| BLI_gset_add(data->ids_handled, id); | |||||
| BLI_LINKSTACK_PUSH(data->ids_todo, id); | |||||
| } | |||||
| } | |||||
| else { | |||||
| BKE_library_foreach_ID_link(id, callback, user_data, flag); | |||||
| } | |||||
| } | |||||
| /** | /** | ||||
| * Loop over all of the ID's this datablock links to. | * Loop over all of the ID's this datablock links to. | ||||
| Context not available. | |||||
| data.ids_handled = BLI_gset_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__); | data.ids_handled = BLI_gset_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, __func__); | ||||
| BLI_LINKSTACK_INIT(data.ids_todo); | BLI_LINKSTACK_INIT(data.ids_todo); | ||||
| BLI_gset_add(data.ids_handled, id); | |||||
| } | } | ||||
| else { | else { | ||||
| data.ids_handled = NULL; | data.ids_handled = NULL; | ||||
| Context not available. | |||||
| CALLBACK_INVOKE(scene->clip, IDWALK_USER); | CALLBACK_INVOKE(scene->clip, IDWALK_USER); | ||||
| if (scene->nodetree) { | if (scene->nodetree) { | ||||
| /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ | /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ | ||||
| library_foreach_ID_as_subdata_link((ID *)scene->nodetree, callback, user_data, flag, &data); | BKE_library_foreach_ID_link((ID *)scene->nodetree, callback, user_data, flag); | ||||
| } | } | ||||
| /* DO NOT handle scene->basact here, it's doubling with the loop over whole scene->base later, | /* DO NOT handle scene->basact here, it's doubling with the loop over whole scene->base later, | ||||
| * since basact is just a pointer to one of those items. */ | * since basact is just a pointer to one of those items. */ | ||||
| Context not available. | |||||
| } | } | ||||
| if (material->nodetree) { | if (material->nodetree) { | ||||
| /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ | /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ | ||||
| library_foreach_ID_as_subdata_link((ID *)material->nodetree, callback, user_data, flag, &data); | BKE_library_foreach_ID_link((ID *)material->nodetree, callback, user_data, flag); | ||||
| } | } | ||||
| CALLBACK_INVOKE(material->group, IDWALK_USER); | CALLBACK_INVOKE(material->group, IDWALK_USER); | ||||
| break; | break; | ||||
| Context not available. | |||||
| Tex *texture = (Tex *) id; | Tex *texture = (Tex *) id; | ||||
| if (texture->nodetree) { | if (texture->nodetree) { | ||||
| /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ | /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ | ||||
| library_foreach_ID_as_subdata_link((ID *)texture->nodetree, callback, user_data, flag, &data); | BKE_library_foreach_ID_link((ID *)texture->nodetree, callback, user_data, flag); | ||||
| } | } | ||||
| CALLBACK_INVOKE(texture->ima, IDWALK_USER); | CALLBACK_INVOKE(texture->ima, IDWALK_USER); | ||||
| if (texture->env) { | if (texture->env) { | ||||
| Context not available. | |||||
| } | } | ||||
| if (lamp->nodetree) { | if (lamp->nodetree) { | ||||
| /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ | /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ | ||||
| library_foreach_ID_as_subdata_link((ID *)lamp->nodetree, callback, user_data, flag, &data); | BKE_library_foreach_ID_link((ID *)lamp->nodetree, callback, user_data, flag); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| if (world->nodetree) { | if (world->nodetree) { | ||||
| /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ | /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ | ||||
| library_foreach_ID_as_subdata_link((ID *)world->nodetree, callback, user_data, flag, &data); | BKE_library_foreach_ID_link((ID *)world->nodetree, callback, user_data, flag); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| if (linestyle->nodetree) { | if (linestyle->nodetree) { | ||||
| /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ | /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ | ||||
| library_foreach_ID_as_subdata_link((ID *)linestyle->nodetree, callback, user_data, flag, &data); | BKE_library_foreach_ID_link((ID *)linestyle->nodetree, callback, user_data, flag); | ||||
| } | } | ||||
| for (lsm = linestyle->color_modifiers.first; lsm; lsm = lsm->next) { | for (lsm = linestyle->color_modifiers.first; lsm; lsm = lsm->next) { | ||||
| Context not available. | |||||
| if ((GS(self_id->name) == ID_KE) && (((Key *)self_id)->from == *id_p)) { | if ((GS(self_id->name) == ID_KE) && (((Key *)self_id)->from == *id_p)) { | ||||
| return IDWALK_RET_NOP; | return IDWALK_RET_NOP; | ||||
| } | } | ||||
| /* XXX another hack, for similar reasons as above one. */ | |||||
| if ((GS(self_id->name) == ID_OB) && (((Object *)self_id)->proxy_from == (Object *)*id_p)) { | |||||
| return IDWALK_RET_NOP; | |||||
| } | |||||
| if (*id_p && (*id_p == iter->id)) { | if (*id_p && (*id_p == iter->id)) { | ||||
| #if 0 | #if 0 | ||||
| Context not available. | |||||