LibQuery: Add macro to help break looping when requested.

The new `BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL` execute the given
statement and then check status of `LibraryForeachIDData` data, and
return in case stop of iteration is requested.

This is very similar to the other `BKE_LIB_FOREACHID_PROCESS_` existing
macros, and allows us to properly break iteration when a sub-function
has requested it.

Part of T90922: Fix return policy inconsistency in `scene_foreach_id`.
This commit is contained in:
Bastien Montagne 2021-10-27 11:30:43 +02:00
parent 51c1c1cd93
commit e3b2f0fd6f
Notes: blender-bot 2023-02-14 07:40:56 +01:00
Referenced by commit e1db6dc11b, Fix crash on undo after recent lib_query refactor.
19 changed files with 186 additions and 94 deletions

View File

@ -172,6 +172,15 @@ int BKE_lib_query_foreachid_process_callback_flag_override(struct LibraryForeach
} \
((void)0)
#define BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(_data, _func_call) \
{ \
_func_call; \
if (BKE_lib_query_foreachid_iter_stop((_data))) { \
return; \
} \
} \
((void)0)
bool BKE_library_foreach_ID_embedded(struct LibraryForeachIDData *data, struct ID **id_pp);
void BKE_lib_query_idpropertiesForeachIDLink_callback(struct IDProperty *id_prop, void *user_data);

View File

@ -175,7 +175,7 @@ static void action_foreach_id(ID *id, LibraryForeachIDData *data)
bAction *act = (bAction *)id;
LISTBASE_FOREACH (FCurve *, fcu, &act->curves) {
BKE_fcurve_foreach_id(fcu, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, BKE_fcurve_foreach_id(fcu, data));
}
LISTBASE_FOREACH (TimeMarker *, marker, &act->markers) {

View File

@ -294,7 +294,7 @@ bool BKE_animdata_id_is_animated(const struct ID *id)
void BKE_animdata_foreach_id(AnimData *adt, LibraryForeachIDData *data)
{
LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
BKE_fcurve_foreach_id(fcu, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, BKE_fcurve_foreach_id(fcu, data));
}
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, adt->action, IDWALK_CB_USER);

View File

@ -161,30 +161,36 @@ static void armature_free_data(struct ID *id)
static void armature_foreach_id_bone(Bone *bone, LibraryForeachIDData *data)
{
IDP_foreach_property(
bone->prop, IDP_TYPE_FILTER_ID, BKE_lib_query_idpropertiesForeachIDLink_callback, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
IDP_foreach_property(
bone->prop, IDP_TYPE_FILTER_ID, BKE_lib_query_idpropertiesForeachIDLink_callback, data));
LISTBASE_FOREACH (Bone *, curbone, &bone->childbase) {
armature_foreach_id_bone(curbone, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, armature_foreach_id_bone(curbone, data));
}
}
static void armature_foreach_id_editbone(EditBone *edit_bone, LibraryForeachIDData *data)
{
IDP_foreach_property(
edit_bone->prop, IDP_TYPE_FILTER_ID, BKE_lib_query_idpropertiesForeachIDLink_callback, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
IDP_foreach_property(edit_bone->prop,
IDP_TYPE_FILTER_ID,
BKE_lib_query_idpropertiesForeachIDLink_callback,
data));
}
static void armature_foreach_id(ID *id, LibraryForeachIDData *data)
{
bArmature *arm = (bArmature *)id;
LISTBASE_FOREACH (Bone *, bone, &arm->bonebase) {
armature_foreach_id_bone(bone, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, armature_foreach_id_bone(bone, data));
}
if (arm->edbo != NULL) {
LISTBASE_FOREACH (EditBone *, edit_bone, arm->edbo) {
armature_foreach_id_editbone(edit_bone, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, armature_foreach_id_editbone(edit_bone, data));
}
}
}

View File

@ -213,8 +213,9 @@ static void brush_foreach_id(ID *id, LibraryForeachIDData *data)
if (brush->gpencil_settings) {
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, brush->gpencil_settings->material, IDWALK_CB_USER);
}
BKE_texture_mtex_foreach_id(data, &brush->mtex);
BKE_texture_mtex_foreach_id(data, &brush->mask_mtex);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, BKE_texture_mtex_foreach_id(data, &brush->mtex));
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data,
BKE_texture_mtex_foreach_id(data, &brush->mask_mtex));
}
static void brush_blend_write(BlendWriter *writer, ID *id, const void *id_address)

View File

@ -205,12 +205,16 @@ void BKE_fcurve_foreach_id(FCurve *fcu, LibraryForeachIDData *data)
FMod_Python *fcm_py = (FMod_Python *)fcm->data;
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, fcm_py->script, IDWALK_CB_NOP);
IDP_foreach_property(fcm_py->prop,
IDP_TYPE_FILTER_ID,
BKE_lib_query_idpropertiesForeachIDLink_callback,
data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
IDP_foreach_property(fcm_py->prop,
IDP_TYPE_FILTER_ID,
BKE_lib_query_idpropertiesForeachIDLink_callback,
data));
break;
}
default:
break;
}
}
}

View File

@ -129,7 +129,8 @@ static void light_foreach_id(ID *id, LibraryForeachIDData *data)
Light *lamp = (Light *)id;
if (lamp->nodetree) {
/* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */
BKE_library_foreach_ID_embedded(data, (ID **)&lamp->nodetree);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_library_foreach_ID_embedded(data, (ID **)&lamp->nodetree));
}
}

View File

@ -155,12 +155,14 @@ static void linestyle_foreach_id(ID *id, LibraryForeachIDData *data)
for (int i = 0; i < MAX_MTEX; i++) {
if (linestyle->mtex[i]) {
BKE_texture_mtex_foreach_id(data, linestyle->mtex[i]);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_texture_mtex_foreach_id(data, linestyle->mtex[i]));
}
}
if (linestyle->nodetree) {
/* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */
BKE_library_foreach_ID_embedded(data, (ID **)&linestyle->nodetree);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_library_foreach_ID_embedded(data, (ID **)&linestyle->nodetree));
}
LISTBASE_FOREACH (LineStyleModifier *, lsm, &linestyle->color_modifiers) {

View File

@ -166,9 +166,8 @@ static void material_foreach_id(ID *id, LibraryForeachIDData *data)
{
Material *material = (Material *)id;
/* Nodetrees **are owned by IDs**, treat them as mere sub-data and not real ID! */
if (!BKE_library_foreach_ID_embedded(data, (ID **)&material->nodetree)) {
return;
}
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_library_foreach_ID_embedded(data, (ID **)&material->nodetree));
if (material->texpaintslot != NULL) {
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, material->texpaintslot->ima, IDWALK_CB_NOP);
}

View File

@ -491,11 +491,11 @@ void BKE_nla_strip_foreach_id(NlaStrip *strip, LibraryForeachIDData *data)
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, strip->act, IDWALK_CB_USER);
LISTBASE_FOREACH (FCurve *, fcu, &strip->fcurves) {
BKE_fcurve_foreach_id(fcu, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, BKE_fcurve_foreach_id(fcu, data));
}
LISTBASE_FOREACH (NlaStrip *, substrip, &strip->strips) {
BKE_nla_strip_foreach_id(substrip, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, BKE_nla_strip_foreach_id(substrip, data));
}
}

View File

@ -307,8 +307,10 @@ static void ntree_free_data(ID *id)
static void library_foreach_node_socket(LibraryForeachIDData *data, bNodeSocket *sock)
{
IDP_foreach_property(
sock->prop, IDP_TYPE_FILTER_ID, BKE_lib_query_idpropertiesForeachIDLink_callback, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
IDP_foreach_property(
sock->prop, IDP_TYPE_FILTER_ID, BKE_lib_query_idpropertiesForeachIDLink_callback, data));
switch ((eNodeSocketDatatype)sock->type) {
case SOCK_OBJECT: {
@ -360,21 +362,25 @@ static void node_foreach_id(ID *id, LibraryForeachIDData *data)
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
BKE_LIB_FOREACHID_PROCESS_ID(data, node->id, IDWALK_CB_USER);
IDP_foreach_property(
node->prop, IDP_TYPE_FILTER_ID, BKE_lib_query_idpropertiesForeachIDLink_callback, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
IDP_foreach_property(node->prop,
IDP_TYPE_FILTER_ID,
BKE_lib_query_idpropertiesForeachIDLink_callback,
data));
LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) {
library_foreach_node_socket(data, sock);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, library_foreach_node_socket(data, sock));
}
LISTBASE_FOREACH (bNodeSocket *, sock, &node->outputs) {
library_foreach_node_socket(data, sock);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, library_foreach_node_socket(data, sock));
}
}
LISTBASE_FOREACH (bNodeSocket *, sock, &ntree->inputs) {
library_foreach_node_socket(data, sock);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, library_foreach_node_socket(data, sock));
}
LISTBASE_FOREACH (bNodeSocket *, sock, &ntree->outputs) {
library_foreach_node_socket(data, sock);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, library_foreach_node_socket(data, sock));
}
}

View File

@ -389,7 +389,8 @@ static void library_foreach_modifiersForeachIDLink(void *user_data,
int cb_flag)
{
LibraryForeachIDData *data = (LibraryForeachIDData *)user_data;
BKE_lib_query_foreachid_process(data, id_pointer, cb_flag);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_lib_query_foreachid_process(data, id_pointer, cb_flag));
}
static void library_foreach_gpencil_modifiersForeachIDLink(void *user_data,
@ -398,7 +399,8 @@ static void library_foreach_gpencil_modifiersForeachIDLink(void *user_data,
int cb_flag)
{
LibraryForeachIDData *data = (LibraryForeachIDData *)user_data;
BKE_lib_query_foreachid_process(data, id_pointer, cb_flag);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_lib_query_foreachid_process(data, id_pointer, cb_flag));
}
static void library_foreach_shaderfxForeachIDLink(void *user_data,
@ -407,7 +409,8 @@ static void library_foreach_shaderfxForeachIDLink(void *user_data,
int cb_flag)
{
LibraryForeachIDData *data = (LibraryForeachIDData *)user_data;
BKE_lib_query_foreachid_process(data, id_pointer, cb_flag);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_lib_query_foreachid_process(data, id_pointer, cb_flag));
}
static void library_foreach_constraintObjectLooper(bConstraint *UNUSED(con),
@ -417,7 +420,8 @@ static void library_foreach_constraintObjectLooper(bConstraint *UNUSED(con),
{
LibraryForeachIDData *data = (LibraryForeachIDData *)user_data;
const int cb_flag = is_reference ? IDWALK_CB_USER : IDWALK_CB_NOP;
BKE_lib_query_foreachid_process(data, id_pointer, cb_flag);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_lib_query_foreachid_process(data, id_pointer, cb_flag));
}
static void library_foreach_particlesystemsObjectLooper(ParticleSystem *UNUSED(psys),
@ -426,7 +430,8 @@ static void library_foreach_particlesystemsObjectLooper(ParticleSystem *UNUSED(p
int cb_flag)
{
LibraryForeachIDData *data = (LibraryForeachIDData *)user_data;
BKE_lib_query_foreachid_process(data, id_pointer, cb_flag);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_lib_query_foreachid_process(data, id_pointer, cb_flag));
}
static void object_foreach_id(ID *id, LibraryForeachIDData *data)
@ -493,10 +498,18 @@ static void object_foreach_id(ID *id, LibraryForeachIDData *data)
const int cb_flag_orig = BKE_lib_query_foreachid_process_callback_flag_override(
data, proxy_cb_flag, false);
LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
IDP_foreach_property(
pchan->prop, IDP_TYPE_FILTER_ID, BKE_lib_query_idpropertiesForeachIDLink_callback, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
IDP_foreach_property(pchan->prop,
IDP_TYPE_FILTER_ID,
BKE_lib_query_idpropertiesForeachIDLink_callback,
data));
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, pchan->custom, IDWALK_CB_USER);
BKE_constraints_id_loop(&pchan->constraints, library_foreach_constraintObjectLooper, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
BKE_constraints_id_loop(
&pchan->constraints, library_foreach_constraintObjectLooper, data));
}
BKE_lib_query_foreachid_process_callback_flag_override(data, cb_flag_orig, true);
}
@ -508,14 +521,21 @@ static void object_foreach_id(ID *id, LibraryForeachIDData *data)
data, object->rigidbody_constraint->ob2, IDWALK_CB_NEVER_SELF);
}
BKE_modifiers_foreach_ID_link(object, library_foreach_modifiersForeachIDLink, data);
BKE_gpencil_modifiers_foreach_ID_link(
object, library_foreach_gpencil_modifiersForeachIDLink, data);
BKE_constraints_id_loop(&object->constraints, library_foreach_constraintObjectLooper, data);
BKE_shaderfx_foreach_ID_link(object, library_foreach_shaderfxForeachIDLink, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_modifiers_foreach_ID_link(object, library_foreach_modifiersForeachIDLink, data));
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
BKE_gpencil_modifiers_foreach_ID_link(
object, library_foreach_gpencil_modifiersForeachIDLink, data));
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
BKE_constraints_id_loop(&object->constraints, library_foreach_constraintObjectLooper, data));
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_shaderfx_foreach_ID_link(object, library_foreach_shaderfxForeachIDLink, data));
LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
BKE_particlesystem_id_loop(psys, library_foreach_particlesystemsObjectLooper, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_particlesystem_id_loop(psys, library_foreach_particlesystemsObjectLooper, data));
}
if (object->soft) {

View File

@ -180,7 +180,8 @@ static void particle_settings_foreach_id(ID *id, LibraryForeachIDData *data)
for (int i = 0; i < MAX_MTEX; i++) {
if (psett->mtex[i]) {
BKE_texture_mtex_foreach_id(data, psett->mtex[i]);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data,
BKE_texture_mtex_foreach_id(data, psett->mtex[i]));
}
}

View File

@ -471,7 +471,8 @@ static void scene_foreach_rigidbodyworldSceneLooper(struct RigidBodyWorld *UNUSE
int cb_flag)
{
LibraryForeachIDData *data = (LibraryForeachIDData *)user_data;
BKE_lib_query_foreachid_process(data, id_pointer, cb_flag);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_lib_query_foreachid_process(data, id_pointer, cb_flag));
}
/**
@ -629,16 +630,28 @@ static void scene_foreach_toolsettings(LibraryForeachIDData *data,
IDWALK_CB_USER);
if (toolsett->vpaint) {
scene_foreach_paint(
data, &toolsett->vpaint->paint, do_undo_restore, reader, &toolsett_old->vpaint->paint);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data,
scene_foreach_paint(data,
&toolsett->vpaint->paint,
do_undo_restore,
reader,
&toolsett_old->vpaint->paint));
}
if (toolsett->wpaint) {
scene_foreach_paint(
data, &toolsett->wpaint->paint, do_undo_restore, reader, &toolsett_old->wpaint->paint);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data,
scene_foreach_paint(data,
&toolsett->wpaint->paint,
do_undo_restore,
reader,
&toolsett_old->wpaint->paint));
}
if (toolsett->sculpt) {
scene_foreach_paint(
data, &toolsett->sculpt->paint, do_undo_restore, reader, &toolsett_old->sculpt->paint);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data,
scene_foreach_paint(data,
&toolsett->sculpt->paint,
do_undo_restore,
reader,
&toolsett_old->sculpt->paint));
BKE_LIB_FOREACHID_UNDO_PRESERVE_PROCESS(data,
toolsett->sculpt->gravity_object,
do_undo_restore,
@ -648,33 +661,47 @@ static void scene_foreach_toolsettings(LibraryForeachIDData *data,
IDWALK_CB_NOP);
}
if (toolsett->uvsculpt) {
scene_foreach_paint(
data, &toolsett->uvsculpt->paint, do_undo_restore, reader, &toolsett_old->uvsculpt->paint);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data,
scene_foreach_paint(data,
&toolsett->uvsculpt->paint,
do_undo_restore,
reader,
&toolsett_old->uvsculpt->paint));
}
if (toolsett->gp_paint) {
scene_foreach_paint(
data, &toolsett->gp_paint->paint, do_undo_restore, reader, &toolsett_old->gp_paint->paint);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data,
scene_foreach_paint(data,
&toolsett->gp_paint->paint,
do_undo_restore,
reader,
&toolsett_old->gp_paint->paint));
}
if (toolsett->gp_vertexpaint) {
scene_foreach_paint(data,
&toolsett->gp_vertexpaint->paint,
do_undo_restore,
reader,
&toolsett_old->gp_vertexpaint->paint);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
scene_foreach_paint(data,
&toolsett->gp_vertexpaint->paint,
do_undo_restore,
reader,
&toolsett_old->gp_vertexpaint->paint));
}
if (toolsett->gp_sculptpaint) {
scene_foreach_paint(data,
&toolsett->gp_sculptpaint->paint,
do_undo_restore,
reader,
&toolsett_old->gp_sculptpaint->paint);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
scene_foreach_paint(data,
&toolsett->gp_sculptpaint->paint,
do_undo_restore,
reader,
&toolsett_old->gp_sculptpaint->paint));
}
if (toolsett->gp_weightpaint) {
scene_foreach_paint(data,
&toolsett->gp_weightpaint->paint,
do_undo_restore,
reader,
&toolsett_old->gp_weightpaint->paint);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
scene_foreach_paint(data,
&toolsett->gp_weightpaint->paint,
do_undo_restore,
reader,
&toolsett_old->gp_weightpaint->paint));
}
BKE_LIB_FOREACHID_UNDO_PRESERVE_PROCESS(data,
@ -746,15 +773,18 @@ static void scene_foreach_id(ID *id, LibraryForeachIDData *data)
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, scene->r.bake.cage_object, IDWALK_CB_NOP);
if (scene->nodetree) {
/* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */
BKE_library_foreach_ID_embedded(data, (ID **)&scene->nodetree);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_library_foreach_ID_embedded(data, (ID **)&scene->nodetree));
}
if (scene->ed) {
SEQ_for_each_callback(&scene->ed->seqbase, seq_foreach_member_id_cb, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, SEQ_for_each_callback(&scene->ed->seqbase, seq_foreach_member_id_cb, data));
}
/* This pointer can be NULL during old files reading, better be safe than sorry. */
if (scene->master_collection != NULL) {
BKE_library_foreach_ID_embedded(data, (ID **)&scene->master_collection);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_library_foreach_ID_embedded(data, (ID **)&scene->master_collection));
}
LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
@ -765,7 +795,8 @@ static void scene_foreach_id(ID *id, LibraryForeachIDData *data)
data, base->object, IDWALK_CB_NOP | IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE);
}
scene_foreach_layer_collection(data, &view_layer->layer_collections);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, scene_foreach_layer_collection(data, &view_layer->layer_collections));
LISTBASE_FOREACH (FreestyleModuleConfig *, fmc, &view_layer->freestyle_config.modules) {
if (fmc->script) {
@ -786,18 +817,25 @@ static void scene_foreach_id(ID *id, LibraryForeachIDData *data)
LISTBASE_FOREACH (TimeMarker *, marker, &scene->markers) {
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, marker->camera, IDWALK_CB_NOP);
IDP_foreach_property(
marker->prop, IDP_TYPE_FILTER_ID, BKE_lib_query_idpropertiesForeachIDLink_callback, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
IDP_foreach_property(marker->prop,
IDP_TYPE_FILTER_ID,
BKE_lib_query_idpropertiesForeachIDLink_callback,
data));
}
ToolSettings *toolsett = scene->toolsettings;
if (toolsett) {
scene_foreach_toolsettings(data, toolsett, false, NULL, toolsett);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, scene_foreach_toolsettings(data, toolsett, false, NULL, toolsett));
}
if (scene->rigidbody_world) {
BKE_rigidbody_world_id_loop(
scene->rigidbody_world, scene_foreach_rigidbodyworldSceneLooper, data);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data,
BKE_rigidbody_world_id_loop(
scene->rigidbody_world, scene_foreach_rigidbodyworldSceneLooper, data));
}
}

View File

@ -120,8 +120,8 @@ void BKE_screen_foreach_id_screen_area(LibraryForeachIDData *data, ScrArea *area
}
case SPACE_GRAPH: {
SpaceGraph *sipo = (SpaceGraph *)sl;
screen_foreach_id_dopesheet(data, sipo->ads);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data,
screen_foreach_id_dopesheet(data, sipo->ads));
break;
}
case SPACE_PROPERTIES: {
@ -151,8 +151,8 @@ void BKE_screen_foreach_id_screen_area(LibraryForeachIDData *data, ScrArea *area
}
case SPACE_NLA: {
SpaceNla *snla = (SpaceNla *)sl;
screen_foreach_id_dopesheet(data, snla->ads);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data,
screen_foreach_id_dopesheet(data, snla->ads));
break;
}
case SPACE_TEXT: {
@ -233,12 +233,13 @@ void BKE_screen_foreach_id_screen_area(LibraryForeachIDData *data, ScrArea *area
static void screen_foreach_id(ID *id, LibraryForeachIDData *data)
{
if (BKE_lib_query_foreachid_process_flags_get(data) & IDWALK_INCLUDE_UI) {
bScreen *screen = (bScreen *)id;
if ((BKE_lib_query_foreachid_process_flags_get(data) & IDWALK_INCLUDE_UI) == 0) {
return;
}
bScreen *screen = (bScreen *)id;
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
BKE_screen_foreach_id_screen_area(data, area);
}
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data, BKE_screen_foreach_id_screen_area(data, area));
}
}

View File

@ -103,7 +103,8 @@ static void simulation_foreach_id(ID *id, LibraryForeachIDData *data)
Simulation *simulation = (Simulation *)id;
if (simulation->nodetree) {
/* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */
BKE_library_foreach_ID_embedded(data, (ID **)&simulation->nodetree);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_library_foreach_ID_embedded(data, (ID **)&simulation->nodetree));
}
}

View File

@ -142,7 +142,8 @@ static void texture_foreach_id(ID *id, LibraryForeachIDData *data)
Tex *texture = (Tex *)id;
if (texture->nodetree) {
/* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */
BKE_library_foreach_ID_embedded(data, (ID **)&texture->nodetree);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_library_foreach_ID_embedded(data, (ID **)&texture->nodetree));
}
BKE_LIB_FOREACHID_PROCESS_IDSUPER(data, texture->ima, IDWALK_CB_USER);
}

View File

@ -131,7 +131,8 @@ static void world_foreach_id(ID *id, LibraryForeachIDData *data)
if (world->nodetree) {
/* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */
BKE_library_foreach_ID_embedded(data, (ID **)&world->nodetree);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(
data, BKE_library_foreach_ID_embedded(data, (ID **)&world->nodetree));
}
}

View File

@ -101,7 +101,8 @@ static void window_manager_foreach_id(ID *id, LibraryForeachIDData *data)
if (BKE_lib_query_foreachid_process_flags_get(data) & IDWALK_INCLUDE_UI) {
LISTBASE_FOREACH (ScrArea *, area, &win->global_areas.areabase) {
BKE_screen_foreach_id_screen_area(data, area);
BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL(data,
BKE_screen_foreach_id_screen_area(data, area));
}
}
}