Skip to content

Commit 73f0cee

Browse files
committed
path fixes for 4.16
-FPath::Combine doesn't behave as previously in regards to raw char*. Wrapping path chunks in FString() returns expected behavior.
1 parent 385dd21 commit 73f0cee

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎Source/UnrealEnginePython/Private/UnrealEnginePython.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,24 @@ static void UESetupPythonInterpeter(bool verbose) {
6969

7070
PyObject *py_path = PyDict_GetItemString(py_sys_dict, "path");
7171

72-
char *zip_path = TCHAR_TO_UTF8(*FPaths::ConvertRelativePathToFull(FPaths::Combine(*FPaths::GameContentDir(), UTF8_TO_TCHAR("ue_python.zip"))));
72+
char *zip_path = TCHAR_TO_UTF8(*FPaths::ConvertRelativePathToFull(FPaths::Combine(FPaths::GameContentDir(), FString("ue_python.zip"))));
7373
PyObject *py_zip_path = PyUnicode_FromString(zip_path);
7474
PyList_Insert(py_path, 0, py_zip_path);
7575

76-
char *scripts_path = TCHAR_TO_UTF8(*FPaths::ConvertRelativePathToFull(FPaths::Combine(*FPaths::GameContentDir(), UTF8_TO_TCHAR("Scripts"))));
76+
char *scripts_path = TCHAR_TO_UTF8(*FPaths::ConvertRelativePathToFull(FPaths::Combine(FPaths::GameContentDir(), FString("Scripts"))));
7777
PyObject *py_scripts_path = PyUnicode_FromString(scripts_path);
7878
PyList_Insert(py_path, 0, py_scripts_path);
7979

8080
/* UnrealEnginePython Plugin Content/Scripts path */
8181
FString PluginRoot = IPluginManager::Get().FindPlugin("UnrealEnginePython")->GetBaseDir();
82-
FString ScriptsPath = FPaths::ConvertRelativePathToFull(FPaths::Combine(PluginRoot, "Content/Scripts"));
82+
FString ScriptsPath = FPaths::ConvertRelativePathToFull(FPaths::Combine(PluginRoot, FString("Content/Scripts")));
8383
PyObject *py_plugin_scripts_path = PyUnicode_FromString(TCHAR_TO_UTF8(*ScriptsPath));
8484
PyList_Insert(py_path, 0, py_plugin_scripts_path);
8585

8686
/* add the plugin paths - windows only */
87-
FString PythonHome = FPaths::ConvertRelativePathToFull(FPaths::Combine(*FPaths::GamePluginsDir(), "UnrealEnginePython/Binaries/Win64"));
87+
FString PythonHome = FPaths::ConvertRelativePathToFull(FPaths::Combine(FPaths::GamePluginsDir(), FString("UnrealEnginePython/Binaries/Win64")));
8888
char *python_path = TCHAR_TO_UTF8(*PythonHome);
89-
char *site_path = TCHAR_TO_UTF8(*FPaths::Combine(*PythonHome, "Lib/site-packages"));
89+
char *site_path = TCHAR_TO_UTF8(*FPaths::Combine(FString(PythonHome), FString("Lib/site-packages")));
9090
PyList_Insert(py_path, 0, PyUnicode_FromString(python_path));
9191
PyList_Insert(py_path, 0, PyUnicode_FromString(site_path));
9292

@@ -356,7 +356,7 @@ void FUnrealEnginePythonModule::AddPythonDependentPlugin(const FString& PluginNa
356356
{
357357
//Add plugin Content/Script to sys.path
358358
FString PluginRoot = IPluginManager::Get().FindPlugin(PluginName)->GetBaseDir();
359-
FString ScriptsPath = FPaths::ConvertRelativePathToFull(FPaths::Combine(PluginRoot, "Content/Scripts"));
359+
FString ScriptsPath = FPaths::ConvertRelativePathToFull(FPaths::Combine(PluginRoot, FString("Content/Scripts")));
360360
FUnrealEnginePythonModule::Get().AddPathToSysPath(ScriptsPath);
361361
UE_LOG(LogPython, Log, TEXT("Added %s Plugin Content/Scripts (%s) to sys.path"), *PluginName, *ScriptsPath);
362362

0 commit comments

Comments
 (0)