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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-20 18:55:28 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-20 18:55:28 +0400
commitad07fc19c0fb97540bfe8d259c0b39098b9d7b9b (patch)
treeb65d7c340dc32cd6e7988bea3266962176568d9b /source/blender/python
parent980dab90282ab3ca63ac44b174344a6607934fb9 (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.c13
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;
}