Added "bpydoc" to the global namespace of python scripts, making documentation available no matter what data is open in the current blend file, Directory type was also missing from the subtype enum causing the test rna-dump script to fail.

This commit is contained in:
Campbell Barton 2008-12-16 16:32:48 +00:00
parent 67dfe58f8c
commit 6c2750a6fe
4 changed files with 19 additions and 0 deletions

@ -436,6 +436,7 @@ static void rna_def_property(BlenderRNA *brna)
{PROP_NONE, "NONE", "None", ""},
{PROP_UNSIGNED, "UNSIGNED", "Unsigned Number", ""},
{PROP_FILEPATH, "FILEPATH", "File Path", ""},
{PROP_DIRPATH, "DIRPATH", "Directory Path", ""},
{PROP_COLOR, "COLOR", "Color", ""},
{PROP_VECTOR, "VECTOR", "Vector", ""},
{PROP_MATRIX, "MATRIX", "Matrix", ""},

@ -25,6 +25,9 @@ static PyObject *CreateGlobalDictionary( void )
PyDict_SetItemString( dict, "bpy", item );
Py_DECREF(item);
item = BPY_rna_doc();
PyDict_SetItemString( dict, "bpydoc", item );
Py_DECREF(item);
return dict;
}

@ -1145,3 +1145,17 @@ PyObject *BPY_rna_module( void )
//submodule = Py_InitModule3( "rna", M_rna_methods, "rna module" );
return pyrna_struct_CreatePyObject(&ptr);
}
/* This is a way we can access docstrings for RNA types
* without having the datatypes in blender */
PyObject *BPY_rna_doc( void )
{
PointerRNA ptr;
/* for now, return the base RNA type rather then a real module */
RNA_blender_rna_pointer_create(&ptr);
return pyrna_struct_CreatePyObject(&ptr);
}

@ -44,6 +44,7 @@ typedef struct {
} BPy_PropertyRNA;
PyObject *BPY_rna_module( void );
PyObject *BPY_rna_doc( void );
PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr );
PyObject *pyrna_prop_CreatePyObject( PointerRNA *ptr, PropertyRNA *prop );