diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-11-03 18:31:38 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-11-03 18:31:38 +0400 |
commit | 47cd3cf2259fc738896e6bb0e2955c970e3c62b1 (patch) | |
tree | 88f2b759303f4f262da7dce264024631bc33280b /source/blender/python | |
parent | 5fe0bd800f81b402b86cb4e22939da6b5cf336ed (diff) |
BPY/RNA: determine callback functions that are allowed to write data by a flag
on the function instead of checking the name.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index e649c862bf8..3310057e7f7 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -6953,9 +6953,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param const int is_operator = RNA_struct_is_a(ptr->type, &RNA_Operator); const char *func_id = RNA_function_identifier(func); /* testing, for correctness, not operator and not draw function */ - const short is_readonly = ((strncmp("draw", func_id, 4) == 0) || /* draw or draw_header */ - /*strstr("render", func_id) ||*/ - !is_operator); + const short is_readonly = !(RNA_function_flag(func) & FUNC_ALLOW_WRITE); #endif py_class = RNA_struct_py_type_get(ptr->type); |