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.
This commit is contained in:
2009-06-20 14:55:28 +00:00
parent 980dab9028
commit ad07fc19c0
9 changed files with 143 additions and 14 deletions

View File

@@ -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;
}