From 9f090bac5c7455ab22cd22cc3f6ea94b54d6de33 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sat, 25 Apr 2020 20:58:55 +0200 Subject: IDProperties: add a foreach looper and use it in libquery code. Note: part of fix for T75279. Differential Revision: https://developer.blender.org/D7550 --- source/blender/blenkernel/BKE_idprop.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/blender/blenkernel/BKE_idprop.h') diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h index 2b02895043f..1272127daa0 100644 --- a/source/blender/blenkernel/BKE_idprop.h +++ b/source/blender/blenkernel/BKE_idprop.h @@ -179,6 +179,17 @@ void IDP_Reset(IDProperty *prop, const IDProperty *reference); # define IDP_Id(prop) ((ID *)(prop)->data.pointer) #endif +/** + * Call a callback for each idproperty in the hierarchy under given root one (included). + * + */ +typedef void (*IDPForeachPropertyCallback)(IDProperty *id_property, void *user_data); + +void IDP_foreach_property(struct IDProperty *id_property_root, + const int type_filter, + IDPForeachPropertyCallback callback, + void *user_data); + /* Format IDProperty as strings */ char *IDP_reprN(const struct IDProperty *prop, uint *r_len); void IDP_repr_fn(const IDProperty *prop, -- cgit v1.2.3