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:
authorCampbell Barton <ideasman42@gmail.com>2008-12-27 07:55:45 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-12-27 07:55:45 +0300
commita2369a5e01b9722eea704639f1f2e4f1ea8e8059 (patch)
treeb6ded7f03d2cd7f15eb4616bb0bc3fbd6fa4d62c /source/blender/python/intern
parent017cb7a394ac9c96fb1108f6870c457e44c69590 (diff)
run python when starting blender like 2.4x does (was start/stopping python for each script before)
This way python can call the operator to run other scripts eg... bpyoperator.SCRIPT_OT_run_pyfile(filename = "myop.py")
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r--source/blender/python/intern/bpy_interface.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 2662890f3c8..1b4b611120a 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -39,10 +39,10 @@ static PyObject *CreateGlobalDictionary( bContext *C )
return dict;
}
-static void BPY_start_python( void )
+void BPY_start_python( void )
{
PyThreadState *py_tstate = NULL;
-
+
Py_Initialize( );
//PySys_SetArgv( argc_copy, argv_copy );
@@ -57,7 +57,7 @@ static void BPY_start_python( void )
}
-static void BPY_end_python( void )
+void BPY_end_python( void )
{
PyGILState_Ensure(); /* finalizing, no need to grab the state */
@@ -76,7 +76,7 @@ void BPY_run_python_script( bContext *C, const char *fn )
/* TODO - look into a better way to run a file */
sprintf(pystring, "exec(open(r'%s').read())", fn);
- BPY_start_python();
+ //BPY_start_python();
gilstate = PyGILState_Ensure();
@@ -91,5 +91,5 @@ void BPY_run_python_script( bContext *C, const char *fn )
PyGILState_Release(gilstate);
- BPY_end_python();
+ //BPY_end_python();
}