diff options
author | Bastien Montagne <bastien@blender.org> | 2020-04-25 21:58:55 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-04-28 16:25:19 +0300 |
commit | 9f090bac5c7455ab22cd22cc3f6ea94b54d6de33 (patch) | |
tree | c434f5958335b1f4be6f2de7aba8c240ed8bc1e6 /source/blender/blenkernel/BKE_idprop.h | |
parent | 7d85b6431fc331d9869f945bf7c9f3353b7b8c95 (diff) |
IDProperties: add a foreach looper and use it in libquery code.
Note: part of fix for T75279.
Differential Revision: https://developer.blender.org/D7550
Diffstat (limited to 'source/blender/blenkernel/BKE_idprop.h')
-rw-r--r-- | source/blender/blenkernel/BKE_idprop.h | 11 |
1 files changed, 11 insertions, 0 deletions
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, |