UI: add back Layout.introspect

Add back this function, removed 2e14b7fb97.

Useful for checking operators used in menus.
This commit is contained in:
2020-09-01 15:23:55 +10:00
parent 89ed6b1293
commit 428a1aaf73
7 changed files with 239 additions and 3 deletions

View File

@@ -9010,11 +9010,12 @@ void pyrna_struct_type_extend_capi(struct StructRNA *srna,
py_method = PyClassMethod_New(cfunc);
Py_DECREF(cfunc);
}
else {
/* Currently only static and class methods are used. */
BLI_assert(method->ml_flags & METH_STATIC);
else if (method->ml_flags & METH_STATIC) {
py_method = PyCFunction_New(method, NULL);
}
else {
py_method = PyDescr_NewMethod(type, method);
}
const int err = PyDict_SetItemString(dict, method->ml_name, py_method);
Py_DECREF(py_method);