diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-02-19 11:10:48 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-02-19 14:12:41 +0300 |
commit | dc61a63e3f1bb3773677fb009fd787af7bd5c727 (patch) | |
tree | 8b2248f83c8cd1db109bfbff3be10406382e7749 /source/blender/python | |
parent | eafcbbb4f741cab7990f17eb07aab0843b242ebd (diff) |
PyAPI: include all members in dir(bpy.types)
C/Python defined types were accessible but not exposed in dir(bpy.types)
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index c48a50c5ec6..ad185226aa5 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -7720,6 +7720,14 @@ static PyObject *bpy_types_module_dir(PyObject *self) PyList_APPEND(ret, PyUnicode_FromString(RNA_struct_identifier(srna))); } RNA_PROP_END; + + /* Include the modules `__dict__` for Python only types. */ + PyObject *submodule_dict = PyModule_GetDict(self); + PyObject *key, *value; + Py_ssize_t pos = 0; + while (PyDict_Next(submodule_dict, &pos, &key, &value)) { + PyList_APPEND(ret, key); + } return ret; } |