diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-20 18:55:28 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-20 18:55:28 +0400 |
commit | ad07fc19c0fb97540bfe8d259c0b39098b9d7b9b (patch) | |
tree | b65d7c340dc32cd6e7988bea3266962176568d9b /source/blender/python | |
parent | 980dab90282ab3ca63ac44b174344a6607934fb9 (diff) |
Context
Python dir(context) now gives the items from the data context
too, modified context callbacks to also return a list of items
in the context.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index e4c17e080b7..f28f00e9c02 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -875,6 +875,19 @@ static PyObject *pyrna_struct_dir(BPy_StructRNA * self) RNA_property_collection_end(&iter); } + + if(self->ptr.type == &RNA_Context) { + ListBase lb = CTX_data_dir_get(self->ptr.data); + LinkData *link; + + for(link=lb.first; link; link=link->next) { + pystring = PyUnicode_FromString(link->data); + PyList_Append(ret, pystring); + Py_DECREF(pystring); + } + + BLI_freelistN(&lb); + } return ret; } |