change RNA_struct_find_function to accept a type rather then a PointerRNA, add a check duplicate functions are not defined.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user