Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-09-01 08:23:55 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-09-02 08:58:44 +0300
commit428a1aaf7372aaad793fe7cc03128db18e3ae602 (patch)
tree8ff7b138f3d666d9533e63b448519611c673d009 /source/blender/python/intern/bpy_rna.c
parent89ed6b12936bc2a89b18cf6dbd7b86e0fbc760d3 (diff)
UI: add back Layout.introspect
Add back this function, removed 2e14b7fb9770b. Useful for checking operators used in menus.
Diffstat (limited to 'source/blender/python/intern/bpy_rna.c')
-rw-r--r--source/blender/python/intern/bpy_rna.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index a3ded8813ac..cc981c7c2e1 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -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);