From 428a1aaf7372aaad793fe7cc03128db18e3ae602 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 1 Sep 2020 15:23:55 +1000 Subject: UI: add back Layout.introspect Add back this function, removed 2e14b7fb9770b. Useful for checking operators used in menus. --- source/blender/python/intern/bpy_rna_types_capi.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/blender/python/intern/bpy_rna_types_capi.c') diff --git a/source/blender/python/intern/bpy_rna_types_capi.c b/source/blender/python/intern/bpy_rna_types_capi.c index 5a2ba4a5cdb..30623724593 100644 --- a/source/blender/python/intern/bpy_rna_types_capi.c +++ b/source/blender/python/intern/bpy_rna_types_capi.c @@ -38,6 +38,7 @@ #include "bpy_rna_callback.h" #include "bpy_rna_id_collection.h" #include "bpy_rna_types_capi.h" +#include "bpy_rna_ui.h" #include "../generic/py_capi_utils.h" @@ -72,6 +73,17 @@ static struct PyMethodDef pyrna_blenddatalibraries_methods[] = { /** \} */ +/* -------------------------------------------------------------------- */ +/** \name UI Layout + * \{ */ + +static struct PyMethodDef pyrna_uilayout_methods[] = { + {NULL, NULL, 0, NULL}, /* #BPY_rna_uilayout_introspect_method_def */ + {NULL, NULL, 0, NULL}, +}; + +/** \} */ + /* -------------------------------------------------------------------- */ /** \name Window Manager Clipboard Property * @@ -205,6 +217,11 @@ void BPY_rna_types_extend_capi(void) BLI_assert(ARRAY_SIZE(pyrna_blenddatalibraries_methods) == 3); pyrna_struct_type_extend_capi(&RNA_BlendDataLibraries, pyrna_blenddatalibraries_methods, NULL); + /* uiLayout */ + ARRAY_SET_ITEMS(pyrna_uilayout_methods, BPY_rna_uilayout_introspect_method_def); + BLI_assert(ARRAY_SIZE(pyrna_uilayout_methods) == 2); + pyrna_struct_type_extend_capi(&RNA_UILayout, pyrna_uilayout_methods, NULL); + /* Space */ pyrna_struct_type_extend_capi(&RNA_Space, pyrna_space_methods, NULL); -- cgit v1.2.3