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:
authorCampbell Barton <ideasman42@gmail.com>2012-01-11 20:48:22 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-11 20:48:22 +0400
commit02560d748f454b87f756908268f0a2c6bdde934a (patch)
treec9d8930e7fc77c795f27d2bd67d3d6284b08eeda /source/blender/makesrna/intern/rna_access.c
parentf66f33cefcdd3ff5be2c3940aa494bd52a75d074 (diff)
add RNA_property_is_set function, use for WM_menu_invoke to avoid double lookup and py api to de-duplicate some checks
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 41641af6514..ddd0fa1434c 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -4412,15 +4412,22 @@ int RNA_collection_length(PointerRNA *ptr, const char *name)
}
}
-int RNA_struct_property_is_set(PointerRNA *ptr, const char *name)
+int RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
{
- PropertyRNA *prop= RNA_struct_find_property(ptr, name);
+ if(prop->flag & PROP_IDPROPERTY) {
+ return (rna_idproperty_find(ptr, prop->identifier) != NULL);
+ }
+ else {
+ return 1;
+ }
+}
+
+int RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
+{
+ PropertyRNA *prop= RNA_struct_find_property(ptr, identifier);
if(prop) {
- if(prop->flag & PROP_IDPROPERTY)
- return (rna_idproperty_find(ptr, name) != NULL);
- else
- return 1;
+ return RNA_property_is_set(ptr, prop);
}
else {
/* python raises an error */