Skip to content

Commit 097ea4a

Browse files
committed
4.24.3 packaging fixes and added Script Runner module
1 parent 246a875 commit 097ea4a

File tree

12 files changed

+168
-62
lines changed

12 files changed

+168
-62
lines changed

Source/PythonAutomation/PythonAutomation.Build.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,25 @@ public PythonAutomation(TargetInfo Target)
1313
{
1414
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
1515
string enableUnityBuild = System.Environment.GetEnvironmentVariable("UEP_ENABLE_UNITY_BUILD");
16-
bUseUnity = string.IsNullOrEmpty(enableUnityBuild);
16+
bUseUnity = !string.IsNullOrEmpty(enableUnityBuild);
17+
1718
PrivateIncludePaths.AddRange(
18-
new string[] {
19+
new string[]
20+
{
1921
"PythonConsole/Private",
20-
// ... add other private include paths required here ...
21-
}
22+
// ... add other private include paths required here ...
23+
}
2224
);
2325

2426
PrivateDependencyModuleNames.AddRange(
25-
new string[] {
27+
new string[]
28+
{
2629
"Core",
2730
"CoreUObject", // @todo Mac: for some reason it's needed to link in debug on Mac
28-
"Engine",
31+
"Engine",
2932
"UnrealEd",
3033
"UnrealEnginePython"
3134
}
3235
);
33-
3436
}
35-
}
37+
}

Source/PythonConsole/PythonConsole.Build.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,22 @@ public PythonConsole(TargetInfo Target)
1313
{
1414
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
1515
string enableUnityBuild = System.Environment.GetEnvironmentVariable("UEP_ENABLE_UNITY_BUILD");
16-
bUseUnity = string.IsNullOrEmpty(enableUnityBuild);
16+
bUseUnity = !string.IsNullOrEmpty(enableUnityBuild);
1717

1818
PrivateIncludePaths.AddRange(
19-
new string[] {
19+
new string[]
20+
{
2021
"PythonConsole/Private",
21-
// ... add other private include paths required here ...
22-
}
22+
// ... add other private include paths required here ...
23+
}
2324
);
2425

2526
PrivateDependencyModuleNames.AddRange(
26-
new string[] {
27+
new string[]
28+
{
2729
"Core",
2830
"CoreUObject", // @todo Mac: for some reason it's needed to link in debug on Mac
29-
"Engine",
31+
"Engine",
3032
"InputCore",
3133
"UnrealEd",
3234
"Slate",
@@ -36,6 +38,5 @@ public PythonConsole(TargetInfo Target)
3638
"UnrealEnginePython"
3739
}
3840
);
39-
4041
}
41-
}
42+
}

Source/PythonEditor/Private/DirectoryScanner.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ struct FDirectoryScannerCommand : public IQueuedWork
4949
{
5050
if(bIsDirectory)
5151
{
52-
FoundFiles.Push(new FDirectoryResult(FilenameOrDirectory, EPythonProjectItemType::Folder));
52+
if (!FPaths::GetCleanFilename(FilenameOrDirectory).StartsWith("."))
53+
FoundFiles.Push(new FDirectoryResult(FilenameOrDirectory, EPythonProjectItemType::Folder));
5354
}
5455
else
5556
{

Source/PythonEditor/PythonEditor.Build.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ public PythonEditor(ReadOnlyTargetRules Target) : base(Target)
1010
public PythonEditor(TargetInfo Target)
1111
#endif
1212
{
13-
1413
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
1514
string enableUnityBuild = System.Environment.GetEnvironmentVariable("UEP_ENABLE_UNITY_BUILD");
16-
bUseUnity = string.IsNullOrEmpty(enableUnityBuild);
15+
bUseUnity = !string.IsNullOrEmpty(enableUnityBuild);
1716

1817
PrivateIncludePaths.AddRange(
19-
new string[] {
18+
new string[]
19+
{
2020
"PythonEditor/Private",
2121
}
22-
);
22+
);
2323

2424
PrivateDependencyModuleNames.AddRange(
2525
new string[]
@@ -33,15 +33,15 @@ public PythonEditor(TargetInfo Target)
3333
"EditorStyle",
3434
"PropertyEditor",
3535
"ContentBrowser",
36-
"Kismet", // for FWorkflowCentricApplication
37-
"InputCore",
36+
"Kismet", // for FWorkflowCentricApplication
37+
"InputCore",
3838
"DirectoryWatcher",
3939
"LevelEditor",
4040
"Projects",
4141
"Engine",
4242
"UnrealEnginePython"
4343
}
44-
);
44+
);
4545
}
4646
}
4747
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
2+
3+
#include "PythonScriptRunnerModule.h"
4+
#include "UnrealEnginePython.h"
5+
6+
#include "CommandLine.h"
7+
8+
9+
IMPLEMENT_MODULE(FPythonScriptRunnerModule, PythonScriptRunner);
10+
11+
12+
void FPythonScriptRunnerModule::StartupModule()
13+
{
14+
FString ScriptPath;
15+
if (FParse::Value(FCommandLine::Get(), TEXT("-run_script="), ScriptPath))
16+
{
17+
UE_LOG(LogTemp, Display, TEXT("FPythonScriptRunnerModule::StartupModule => Running script: %s"), *ScriptPath);
18+
19+
FUnrealEnginePythonModule& PythonModule = FModuleManager::GetModuleChecked<FUnrealEnginePythonModule>("UnrealEnginePython");
20+
PythonModule.RunFile(TCHAR_TO_UTF8(*ScriptPath));
21+
}
22+
}
23+
24+
void FPythonScriptRunnerModule::ShutdownModule()
25+
{
26+
27+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 1998-2018 20Tab S.r.l. All Rights Reserved.
2+
3+
#pragma once
4+
5+
#include "CoreMinimal.h"
6+
#if ENGINE_MAJOR_VERSION==4 && ENGINE_MINOR_VERSION>=22
7+
#include "Modules/ModuleInterface.h"
8+
#else
9+
#include "ModuleInterface.h"
10+
#endif
11+
12+
class FPythonScriptRunnerModule : public IModuleInterface
13+
{
14+
public:
15+
virtual void StartupModule();
16+
virtual void ShutdownModule();
17+
18+
};
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 1998-2018 20Tab S.r.l All Rights Reserved.
2+
3+
using UnrealBuildTool;
4+
using System.IO;
5+
6+
public class PythonScriptRunner : ModuleRules
7+
{
8+
#if WITH_FORWARDED_MODULE_RULES_CTOR
9+
public PythonScriptRunner(ReadOnlyTargetRules Target) : base(Target)
10+
#else
11+
public PythonScriptRunner(TargetInfo Target)
12+
#endif
13+
{
14+
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
15+
string enableUnityBuild = System.Environment.GetEnvironmentVariable("UEP_ENABLE_UNITY_BUILD");
16+
bUseUnity = !string.IsNullOrEmpty(enableUnityBuild);
17+
18+
PrivateDependencyModuleNames.AddRange(
19+
new string[]
20+
{
21+
"Core",
22+
"CoreUObject", // @todo Mac: for some reason it's needed to link in debug on Mac
23+
"Engine",
24+
"Sockets",
25+
"Networking",
26+
"UnrealEnginePython",
27+
// ... add other public dependencies that you statically link with here ...
28+
}
29+
);
30+
31+
#if WITH_FORWARDED_MODULE_RULES_CTOR
32+
if (Target.bBuildEditor)
33+
#else
34+
if (UEBuildConfiguration.bBuildEditor)
35+
#endif
36+
{
37+
PrivateDependencyModuleNames.AddRange(
38+
new string[]
39+
{
40+
"UnrealEd",
41+
}
42+
);
43+
}
44+
}
45+
}

Source/UnrealEnginePython/Private/Slate/UEPyFMenuBuilder.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#include "UEPyFMenuBuilder.h"
2-
#include "IAssetTools.h"
2+
33
#include "Wrappers/UEPyESlateEnums.h"
44

5+
#if WITH_EDITOR
6+
#include "Developer/AssetTools/Public/IAssetTools.h"
7+
#endif
8+
59
static PyObject* py_ue_fmenu_builder_begin_section(ue_PyFMenuBuilder* self, PyObject* args)
610
{
711
char* name;

Source/UnrealEnginePython/Private/Slate/UEPySTextBlock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static PyObject *py_ue_stext_block_set_text(ue_PySTextBlock *self, PyObject * ar
1111
return nullptr;
1212
}
1313

14-
py_STextBlock->SetText(FString(UTF8_TO_TCHAR(text)));
14+
py_STextBlock->SetText(FText::FromString(UTF8_TO_TCHAR(text)));
1515

1616
Py_RETURN_SLATE_SELF;
1717
}

Source/UnrealEnginePython/Private/UObject/UEPyObject.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,12 +652,13 @@ PyObject *py_ue_can_modify(ue_PyUObject *self, PyObject * args)
652652

653653
ue_py_check(self);
654654

655+
#if WITH_EDITOR
655656
if (self->ue_object->CanModify())
656-
{
657657
Py_RETURN_TRUE;
658-
}
659-
660658
Py_RETURN_FALSE;
659+
#else
660+
Py_RETURN_TRUE;
661+
#endif
661662
}
662663
#endif
663664

0 commit comments

Comments
 (0)