Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-25 01:27:10 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-25 01:27:10 +0400
commit7a357cba3994bee7d05c7a8bf5736eb94067d564 (patch)
tree942d61fdd1138867710ed41604c4d2947565f7b1 /source/blender/makesrna/intern/rna_access.c
parent169fdf9e9757a8c31d950f5902d7c4cfd1f96a88 (diff)
2.5: File Selector: display operator properties in the side region,
check Save Image or Export PLY operator for example. Also these code changes: * Added some RNA collection iterator macros to simplify code. * Fix bpy.props.BoolProperty not working correct. * Merge uiDefAutoButsRNA/uiDefAutoButsRNA_single into one.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c38
1 files changed, 11 insertions, 27 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index a2954d43e0e..66127ebc6df 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -426,23 +426,16 @@ PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
/* Find the property which uses the given nested struct */
PropertyRNA *RNA_struct_find_nested(PointerRNA *ptr, StructRNA *srna)
{
- CollectionPropertyIterator iter;
- PropertyRNA *iterprop, *prop;
- int i = 0;
+ PropertyRNA *prop= NULL;
- iterprop= RNA_struct_iterator_property(ptr->type);
- RNA_property_collection_begin(ptr, iterprop, &iter);
- prop= NULL;
-
- for(; iter.valid; RNA_property_collection_next(&iter), i++) {
+ RNA_STRUCT_BEGIN(ptr, iprop) {
/* This assumes that there can only be one user of this nested struct */
- if (RNA_property_pointer_type(ptr, iter.ptr.data) == srna) {
- prop= iter.ptr.data;
+ if (RNA_property_pointer_type(ptr, iprop) == srna) {
+ prop= iprop;
break;
}
}
-
- RNA_property_collection_end(&iter);
+ RNA_PROP_END;
return prop;
}
@@ -455,25 +448,21 @@ const struct ListBase *RNA_struct_defined_properties(StructRNA *srna)
FunctionRNA *RNA_struct_find_function(PointerRNA *ptr, const char *identifier)
{
PointerRNA tptr;
- CollectionPropertyIterator iter;
PropertyRNA *iterprop;
FunctionRNA *func;
- int i = 0;
RNA_pointer_create(NULL, &RNA_Struct, ptr->type, &tptr);
iterprop= RNA_struct_find_property(&tptr, "functions");
- RNA_property_collection_begin(&tptr, iterprop, &iter);
func= NULL;
- for(; iter.valid; RNA_property_collection_next(&iter), i++) {
- if(strcmp(identifier, RNA_function_identifier(iter.ptr.data)) == 0) {
- func= iter.ptr.data;
+ RNA_PROP_BEGIN(&tptr, funcptr, iterprop) {
+ if(strcmp(identifier, RNA_function_identifier(funcptr.data)) == 0) {
+ func= funcptr.data;
break;
}
}
-
- RNA_property_collection_end(&iter);
+ RNA_PROP_END;
return func;
}
@@ -2256,17 +2245,12 @@ char *RNA_pointer_as_string(PointerRNA *ptr)
DynStr *dynstr= BLI_dynstr_new();
char *cstring;
- PropertyRNA *prop, *iterprop;
- CollectionPropertyIterator iter;
const char *propname;
int first_time = 1;
BLI_dynstr_append(dynstr, "{");
- iterprop= RNA_struct_iterator_property(ptr->type);
-
- for(RNA_property_collection_begin(ptr, iterprop, &iter); iter.valid; RNA_property_collection_next(&iter)) {
- prop= iter.ptr.data;
+ RNA_STRUCT_BEGIN(ptr, prop) {
propname = RNA_property_identifier(prop);
if(strcmp(propname, "rna_type")==0)
@@ -2280,8 +2264,8 @@ char *RNA_pointer_as_string(PointerRNA *ptr)
BLI_dynstr_appendf(dynstr, "\"%s\":%s", propname, cstring);
MEM_freeN(cstring);
}
+ RNA_STRUCT_END;
- RNA_property_collection_end(&iter);
BLI_dynstr_append(dynstr, "}");