Commits

Anonymous committed 82e9efe

Fixed python sys.path

  • Participants
  • Parent commits 7aafb79

Comments (0)

Files changed (1)

File PolyPython/include/PolyPython.cpp

 */
 
 #include "PolyPythonPrerequisites.h"
+#include <boost/filesystem.hpp>
 #include "PolyPythonBindings.h"
 
 #include "PolyPython.h"
 			addNativeComponentType<AudioListenerComponent>();
 			addNativeComponentType<BoxColliderComponent>();
 			addNativeComponentType<MeshColliderComponent>();
+
+			// Add module search path
+			// TODO fixed path for now
+			boost::filesystem::path path(boost::filesystem::current_path() / boost::filesystem::path("..") / "content");
+			path = path.normalize();
+			
+			PyObject* sysPath = PySys_GetObject("path");
+			PyList_Insert( sysPath, 0, PyUnicode_FromString(path.string().c_str()));
 		}
 
 		void runScript(const String& fileName) {