From e3b2f0fd6ff912bac69a94e35ac2f617c720328e Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 27 Oct 2021 11:30:43 +0200 Subject: 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`. --- source/blender/blenkernel/intern/simulation.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/simulation.cc') diff --git a/source/blender/blenkernel/intern/simulation.cc b/source/blender/blenkernel/intern/simulation.cc index 1d297b3ced9..98e7405bde6 100644 --- a/source/blender/blenkernel/intern/simulation.cc +++ b/source/blender/blenkernel/intern/simulation.cc @@ -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)); } } -- cgit v1.2.3