@@ -87,6 +87,10 @@ void FUnrealEnginePythonModule::UESetupPythonInterpreter(bool verbose) {
8787 PyObject *py_scripts_path = PyUnicode_FromString (scripts_path);
8888 PyList_Insert (py_path, 0 , py_scripts_path);
8989
90+ char *additional_modules_path = TCHAR_TO_UTF8 (*AdditionalModulesPath);
91+ PyObject *py_additional_modules_path = PyUnicode_FromString (additional_modules_path);
92+ PyList_Insert (py_path, 0 , py_additional_modules_path);
93+
9094 if (verbose) {
9195 UE_LOG (LogPython, Log, TEXT (" Python VM initialized: %s" ), UTF8_TO_TCHAR (Py_GetVersion ()));
9296 UE_LOG (LogPython, Log, TEXT (" Python Scripts search path: %s" ), UTF8_TO_TCHAR (scripts_path));
@@ -104,6 +108,8 @@ static void setup_stdout_stderr() {
104108 " self.logger(buf)\n "
105109 " def flush(self):\n "
106110 " return\n "
111+ " def isatty(self):\n "
112+ " return False\n "
107113 " sys.stdout = UnrealEngineOutput(unreal_engine.log)\n "
108114 " sys.stderr = UnrealEngineOutput(unreal_engine.log_error)\n " ;
109115 PyRun_SimpleString (code);
@@ -179,6 +185,14 @@ void FUnrealEnginePythonModule::StartupModule()
179185 ScriptsPath = FPaths::Combine (FPaths::GameContentDir (), IniValue);
180186 }
181187
188+ if (GConfig->GetString (UTF8_TO_TCHAR (" Python" ), UTF8_TO_TCHAR (" AdditionalModulesPath" ), IniValue, GEngineIni)) {
189+ AdditionalModulesPath = IniValue;
190+ }
191+
192+ if (GConfig->GetString (UTF8_TO_TCHAR (" Python" ), UTF8_TO_TCHAR (" RelativeAdditionalModulesPath" ), IniValue, GEngineIni)) {
193+ AdditionalModulesPath = FPaths::Combine (FPaths::GameContentDir (), IniValue);
194+ }
195+
182196 if (GConfig->GetString (UTF8_TO_TCHAR (" Python" ), UTF8_TO_TCHAR (" ZipPath" ), IniValue, GEngineIni)) {
183197 ZipPath = IniValue;
184198}
0 commit comments