Changed the script UI registration to import rather then run each python script,

this means it caches the compiled pyc files after importing fro the first time.

My times for importing 501 buttons_objects.py files were.
- running each as a script 1.9sec
- importing for the first time 1.8sec
- importing a second time (using pyc files) 0.57sec

Also added "bpy" to sys.modules so it can be imported.
This commit is contained in:
2009-04-11 05:46:40 +00:00
parent c7b587105f
commit 9d922b4c24
8 changed files with 111 additions and 50 deletions

View File

@@ -262,7 +262,7 @@ static PyObject *pyop_base_rna(PyObject *self, PyObject *pyname)
PyTypeObject pyop_base_Type = {NULL};
PyObject *BPY_operator_module( bContext *C )
PyObject *BPY_operator_module( void )
{
pyop_base_Type.tp_name = "OperatorBase";
pyop_base_Type.tp_basicsize = sizeof( BPy_OperatorBase );