diff options
-rw-r--r-- | source/blender/freestyle/SConscript | 2 | ||||
-rwxr-xr-x | source/blender/freestyle/intern/system/PythonInterpreter.h | 25 |
2 files changed, 17 insertions, 10 deletions
diff --git a/source/blender/freestyle/SConscript b/source/blender/freestyle/SConscript index 623bf0308dd..4f096d35c23 100644 --- a/source/blender/freestyle/SConscript +++ b/source/blender/freestyle/SConscript @@ -92,4 +92,4 @@ env.BlenderLib (libname="bf_freestyle", # g++ -w -I../geometry -I../image -I../scene_graph -I../stroke -I../system -I../view_map -I../winged_edge -I/usr/include/python2.5 -I../../../blenlib -I../../../blenkernel -I../../../imbuf -I../../../makesdna -c ModuleWrapper.cpp -o ModuleWrapper.o # -# g++ -bundle -flat_namespace -undefined suppress -w -L/usr/lib/python2.5/config -lpython2.5 -o ../../python/_Freestyle.so ModuleWrapper.o
\ No newline at end of file +# g++ -bundle -flat_namespace -undefined suppress -w -L/Users/mx/Documents/work/GSoC_2008/bf-blender/branches/build/darwin/lib -L/usr/lib/python2.5/config -lbf_freestyle -lbf_blenlib -lbf_blenkernel -lbf_guardedalloc -lbf_imbuf -lpython2.5 -o ../../python/_Freestyle.so ModuleWrapper.o diff --git a/source/blender/freestyle/intern/system/PythonInterpreter.h b/source/blender/freestyle/intern/system/PythonInterpreter.h index d9b563fabaa..540d0b3ddec 100755 --- a/source/blender/freestyle/intern/system/PythonInterpreter.h +++ b/source/blender/freestyle/intern/system/PythonInterpreter.h @@ -105,15 +105,22 @@ private: if (_initialized) return; - // vector<string> pathnames; - // StringUtils::getPathName(_path, "", pathnames); - // - // for (vector<string>::const_iterator it = pathnames.begin(); it != pathnames.end();++it) { - // if ( !it->empty() ) { - // cout << "Adding Python path: " << *it << endl; - // syspath_append( const_cast<char*>(it->c_str()) ); - // } - // } + vector<string> pathnames; + StringUtils::getPathName(_path, "", pathnames); + + struct Text *text = add_empty_text("initpath_test.txt"); + string cmd = "import sys\n"; + txt_insert_buf(text, const_cast<char*>(cmd.c_str())); + + for (vector<string>::const_iterator it = pathnames.begin(); it != pathnames.end();++it) { + if ( !it->empty() ) { + cout << "Adding Python path: " << *it << endl; + cmd = "sys.path.append(\"" + *it + "\")\n"; + txt_insert_buf(text, const_cast<char*>(cmd.c_str())); + } + } + + BPY_txt_do_python_Text(text); //PyRun_SimpleString("from Freestyle import *"); _initialized = true; |