diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-26 01:57:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-26 01:57:45 +0400 |
commit | 29605fc06ddd8fb9a5d80df1389a0cbfb150c9b9 (patch) | |
tree | 1d951c993e2e31732feaa84263f9c31204173072 /source/blender/makesrna/intern/rna_access.c | |
parent | 82fd7f21fc36e44f5948f2aacabc10aaa36250c7 (diff) |
Added function RNA_property_update_check() to check if an update call is needed,
Simple python benchmark shows this to be about 3x faster in the case where an update isn't needed.
This also speeds up rna function argument parsing, since each arg in a function call did 2 string lookups on the context which were never needed.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 6cb5858648a..6cdb842fbc2 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1268,6 +1268,14 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR } +/* must keep in sync with 'rna_property_update' + * note, its possible this returns a false positive in the case of PROP_CONTEXT_UPDATE + * but this isnt likely to be a performance problem. */ +int RNA_property_update_check(PropertyRNA *prop) +{ + return (prop->magic != RNA_MAGIC || prop->update || prop->noteflag); +} + void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop) { rna_property_update(C, CTX_data_main(C), CTX_data_scene(C), ptr, prop); |