diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-10 17:34:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-10 17:34:59 +0400 |
commit | f6e21881f5d0f86725836391d20949fe0343bd19 (patch) | |
tree | 12287d7789e683c69ce8c3157293edf7f0f283d2 /source/blender/python | |
parent | 219eca0f515f9a54953566539520fde37f2ea13b (diff) |
change RNA_struct_find_function to accept a type rather then a PointerRNA, add a check duplicate functions are not defined.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 873f5353bff..04f9a90f0d2 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -3467,7 +3467,7 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname) ret = pyrna_prop_to_py(&self->ptr, prop); } /* RNA function only if callback is declared (no optional functions) */ - else if ((func = RNA_struct_find_function(&self->ptr, name)) && RNA_function_defined(func)) { + else if ((func = RNA_struct_find_function(self->ptr.type, name)) && RNA_function_defined(func)) { ret = pyrna_func_to_py(&self->ptr, func); } else if (self->ptr.type == &RNA_Context) { @@ -3780,7 +3780,7 @@ static PyObject *pyrna_prop_collection_getattro(BPy_PropertyRNA *self, PyObject return ret; } - else if ((func = RNA_struct_find_function(&r_ptr, name))) { + else if ((func = RNA_struct_find_function(r_ptr.type, name))) { PyObject *self_collection = pyrna_struct_CreatePyObject(&r_ptr); ret = pyrna_func_to_py(&((BPy_DummyPointerRNA *)self_collection)->ptr, func); Py_DECREF(self_collection); |