X-Git-Url: https://git.blender.org/gitweb/gitweb.cgi/blender-staging.git/blobdiff_plain/169fdf9e9757a8c31d950f5902d7c4cfd1f96a88..7a357cba3994bee7d05c7a8bf5736eb94067d564:/source/blender/makesrna/RNA_access.h diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index bab6982abd9..9f7559312ed 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -695,6 +695,28 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name); RNA_property_collection_end(&rna_macro_iter); \ } +#define RNA_PROP_BEGIN(sptr, itemptr, prop) \ + { \ + CollectionPropertyIterator rna_macro_iter; \ + for(RNA_property_collection_begin(sptr, prop, &rna_macro_iter); rna_macro_iter.valid; RNA_property_collection_next(&rna_macro_iter)) { \ + PointerRNA itemptr= rna_macro_iter.ptr; + +#define RNA_PROP_END \ + } \ + RNA_property_collection_end(&rna_macro_iter); \ + } + +#define RNA_STRUCT_BEGIN(sptr, prop) \ + { \ + CollectionPropertyIterator rna_macro_iter; \ + for(RNA_property_collection_begin(sptr, RNA_struct_iterator_property(sptr->type), &rna_macro_iter); rna_macro_iter.valid; RNA_property_collection_next(&rna_macro_iter)) { \ + PropertyRNA *prop= rna_macro_iter.ptr.data; + +#define RNA_STRUCT_END \ + } \ + RNA_property_collection_end(&rna_macro_iter); \ + } + /* check if the idproperty exists, for operators */ int RNA_property_is_set(PointerRNA *ptr, const char *name);