|
11 | 11 | #endif |
12 | 12 |
|
13 | 13 | #include "Styling/SlateStyleRegistry.h" |
14 | | -#if WITH_EDITOR |
15 | 14 | #include "Interfaces/IPluginManager.h" |
16 | | -#endif |
17 | 15 |
|
18 | 16 | #if ENGINE_MINOR_VERSION >= 18 |
19 | 17 | #define PROJECT_CONTENT_DIR FPaths::ProjectContentDir() |
@@ -307,30 +305,12 @@ void FUnrealEnginePythonModule::StartupModule() |
307 | 305 | // Save the current locale (should be "C") to restore later. TCharTest::RunTest will fail otherwise |
308 | 306 | FString SavedLocale(setlocale(LC_CTYPE, nullptr)); |
309 | 307 |
|
310 | | - // Load python library |
311 | | - FString PluginDir = IPluginManager::Get().FindPlugin(TEXT("UnrealEnginePython"))->GetBaseDir(); |
312 | | - FString PythonDir = FString::Printf(TEXT("Python%d%d"), PY_MAJOR_VERSION, PY_MINOR_VERSION); |
313 | | - |
314 | | - auto LoadDll([](const FString& Path) -> void* |
315 | | - { |
316 | | - void* Handle = FPlatformProcess::GetDllHandle(*Path); |
317 | | - if (Handle == nullptr) |
318 | | - { |
319 | | - UE_LOG(LogPython, Fatal, TEXT("Failed to load module '%s'."), *Path); |
320 | | - } |
321 | | - return Handle; |
322 | | - }); |
323 | | - |
324 | | -#if PLATFORM_WINDOWS |
325 | | - FString DllFilename = FString::Printf(TEXT("python%d%d.dll"), PY_MAJOR_VERSION, PY_MINOR_VERSION); |
326 | | - FString DllPath = PythonDir / TEXT("bin/win64") / DllFilename; |
327 | | - PythonHandle = LoadDll(DllPath); |
328 | | -#endif |
329 | | - |
330 | 308 | // Manual import of data symbols that would prevent delay loading of python dll |
331 | | - LoadPythonSymbols(PythonHandle); |
| 309 | + //LoadPythonSymbols(PythonHandle); |
332 | 310 |
|
333 | 311 | // Point sys.path to the embedded python zip. Extraneous python installations are also cleared out |
| 312 | + FString PluginDir = IPluginManager::Get().FindPlugin(TEXT("UnrealEnginePython"))->GetBaseDir(); |
| 313 | + FString PythonDir = FString::Printf(TEXT("Python%d%d"), PY_MAJOR_VERSION, PY_MINOR_VERSION); |
334 | 314 | FString ZipFilename = FString::Printf(TEXT("python%d%d.zip"), PY_MAJOR_VERSION, PY_MINOR_VERSION); |
335 | 315 | FString ZipPath = FPaths::ConvertRelativePathToFull(FPaths::Combine(PluginDir, TEXT("ThirdParty"), PythonDir, ZipFilename)); |
336 | 316 | #if PY_MAJOR_VERSION >= 3 |
@@ -489,8 +469,6 @@ void FUnrealEnginePythonModule::ShutdownModule() |
489 | 469 | PyGILState_Ensure(); |
490 | 470 | Py_Finalize(); |
491 | 471 | } |
492 | | - |
493 | | - FPlatformProcess::FreeDllHandle(PythonHandle); |
494 | 472 | } |
495 | 473 |
|
496 | 474 | void FUnrealEnginePythonModule::RunString(char *str) |
|
0 commit comments