Skip to content

Commit 7114954

Browse files
SaxonRahDavid
authored andcommitted
Updated to Unreal Engine 4.24.2
Fixed and Removed all Errors and Warnings. Tested a few python scripts, ran editor for long time. Seems to be okay.
1 parent 3ff694e commit 7114954

File tree

16 files changed

+107
-58
lines changed

16 files changed

+107
-58
lines changed

Source/PythonAutomation/PythonAutomation.Build.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ public PythonAutomation(TargetInfo Target)
1313
{
1414
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
1515
string enableUnityBuild = System.Environment.GetEnvironmentVariable("UEP_ENABLE_UNITY_BUILD");
16-
bFasterWithoutUnity = string.IsNullOrEmpty(enableUnityBuild);
17-
16+
bUseUnity = string.IsNullOrEmpty(enableUnityBuild);
1817
PrivateIncludePaths.AddRange(
1918
new string[] {
2019
"PythonConsole/Private",

Source/PythonConsole/PythonConsole.Build.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public PythonConsole(TargetInfo Target)
1313
{
1414
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
1515
string enableUnityBuild = System.Environment.GetEnvironmentVariable("UEP_ENABLE_UNITY_BUILD");
16-
bFasterWithoutUnity = string.IsNullOrEmpty(enableUnityBuild);
16+
bUseUnity = string.IsNullOrEmpty(enableUnityBuild);
1717

1818
PrivateIncludePaths.AddRange(
1919
new string[] {

Source/PythonEditor/Private/PythonEditor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "PythonEditorStyle.h"
88
#include "PythonProjectEditor.h"
99
#include "PythonProject.h"
10+
#include "Subsystems/AssetEditorSubsystem.h"
1011
#include "Runtime/Slate/Public/Framework/MultiBox/MultiBoxBuilder.h"
1112

1213
static const FName PythonEditorTabName( TEXT( "PythonEditor" ) );

Source/PythonEditor/Private/PythonProjectEditor.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
22

33
#include "PythonProjectEditor.h"
4+
5+
#include "Subsystems/AssetEditorSubsystem.h"
6+
7+
// #include "UnrealEd.h"
8+
49
#include "SPythonEditor.h"
510
#include "SPythonProjectEditor.h"
611
#include "Runtime/Slate/Public/Widgets/Docking/SDockTab.h"
@@ -13,6 +18,8 @@
1318
#include "PythonProjectEditorCommands.h"
1419
#include "Runtime/Core/Public/HAL/PlatformFilemanager.h"
1520
#include "Runtime/Core/Public/Misc/MessageDialog.h"
21+
22+
1623
#define LOCTEXT_NAMESPACE "PythonEditor"
1724

1825
TWeakPtr<FPythonProjectEditor> FPythonProjectEditor::PythonEditor;
@@ -209,7 +216,9 @@ void FPythonProjectEditor::RegisterToolbarTab(const TSharedRef<class FTabManager
209216

210217
void FPythonProjectEditor::InitPythonEditor(const EToolkitMode::Type Mode, const TSharedPtr< class IToolkitHost >& InitToolkitHost, class UPythonProject* PythonProject)
211218
{
212-
FAssetEditorManager::Get().CloseOtherEditors(PythonProject, this);
219+
// UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
220+
// GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->CloseOtherEditors(PythonProject, this);
221+
GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->CloseOtherEditors(PythonProject, this);
213222
PythonProjectBeingEdited = PythonProject;
214223

215224
TSharedPtr<FPythonProjectEditor> ThisPtr(SharedThis(this));

Source/PythonEditor/PythonEditor.Build.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public PythonEditor(TargetInfo Target)
1313

1414
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
1515
string enableUnityBuild = System.Environment.GetEnvironmentVariable("UEP_ENABLE_UNITY_BUILD");
16-
bFasterWithoutUnity = string.IsNullOrEmpty(enableUnityBuild);
16+
bUseUnity = string.IsNullOrEmpty(enableUnityBuild);
1717

1818
PrivateIncludePaths.AddRange(
1919
new string[] {
@@ -32,11 +32,13 @@ public PythonEditor(TargetInfo Target)
3232
"UnrealEd",
3333
"EditorStyle",
3434
"PropertyEditor",
35+
"ContentBrowser",
3536
"Kismet", // for FWorkflowCentricApplication
3637
"InputCore",
3738
"DirectoryWatcher",
3839
"LevelEditor",
3940
"Projects",
41+
"Engine",
4042
"UnrealEnginePython"
4143
}
4244
);

Source/UnrealEnginePython/Private/MaterialEditorUtilities/UEPyFMaterialEditorUtilities.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11

22
#include "UEPyFMaterialEditorUtilities.h"
3+
34
#if WITH_EDITOR
45

6+
#include "Subsystems/AssetEditorSubsystem.h"
7+
58
#include "Materials/Material.h"
69
#include "Runtime/Engine/Classes/EdGraph/EdGraph.h"
710

@@ -54,7 +57,9 @@ static PyObject *py_ue_command_apply(PyObject *cls, PyObject * args)
5457
return PyErr_Format(PyExc_Exception, "argument is not a UMaterial");
5558
}
5659

57-
IAssetEditorInstance *Instance = FAssetEditorManager::Get().FindEditorForAsset(Material, false);
60+
//UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
61+
62+
IAssetEditorInstance *Instance = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->FindEditorForAsset(Material, false);
5863
if (!Instance)
5964
{
6065
return PyErr_Format(PyExc_Exception, "unable to retrieve editor for UMaterial");

Source/UnrealEnginePython/Private/Slate/UEPyFMenuBuilder.cpp

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

55
static PyObject* py_ue_fmenu_builder_begin_section(ue_PyFMenuBuilder* self, PyObject* args)
@@ -115,6 +115,8 @@ static PyObject* py_ue_fmenu_builder_add_menu_separator(ue_PyFMenuBuilder* self,
115115
}
116116

117117
#if WITH_EDITOR
118+
#include "ContentBrowserModule.h"
119+
118120
static PyObject* py_ue_fmenu_builder_add_asset_actions(ue_PyFMenuBuilder* self, PyObject* args)
119121
{
120122
PyObject* py_assets;
@@ -140,8 +142,10 @@ static PyObject* py_ue_fmenu_builder_add_asset_actions(ue_PyFMenuBuilder* self,
140142
Py_DECREF(py_assets);
141143

142144
FAssetToolsModule& AssetToolsModule = FModuleManager::LoadModuleChecked<FAssetToolsModule>(TEXT("AssetTools"));
143-
bool addedSomething = AssetToolsModule.Get().GetAssetActions(u_objects, self->menu_builder, true);
144-
if (addedSomething)
145+
146+
FContentBrowserModule& ContentBrowserModule = FModuleManager::LoadModuleChecked<FContentBrowserModule>("ContentBrowser");
147+
TArray<FContentBrowserMenuExtender_SelectedAssets>& AssetMenuExtenderDelegates = ContentBrowserModule.GetAllAssetViewContextMenuExtenders();
148+
if (AssetMenuExtenderDelegates.Num() > 0)
145149
{
146150
Py_RETURN_TRUE;
147151
}

Source/UnrealEnginePython/Private/UEPyEditor.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "UnrealEd.h"
1313
#include "FbxMeshUtils.h"
1414
#include "Kismet2/BlueprintEditorUtils.h"
15+
1516
#include "Editor/LevelEditor/Public/LevelEditorActions.h"
1617
#include "Editor/UnrealEd/Public/EditorLevelUtils.h"
1718
#include "Runtime/Projects/Public/Interfaces/IPluginManager.h"
@@ -41,6 +42,7 @@
4142

4243
#include "UEPyIPlugin.h"
4344

45+
4446
PyObject *py_unreal_engine_redraw_all_viewports(PyObject * self, PyObject * args)
4547
{
4648
FEditorSupportDelegates::RedrawAllViewports.Broadcast();
@@ -1140,7 +1142,9 @@ PyObject *py_unreal_engine_get_selected_assets(PyObject * self, PyObject * args)
11401142

11411143
PyObject *py_unreal_engine_get_all_edited_assets(PyObject * self, PyObject * args)
11421144
{
1143-
TArray<UObject *> assets = FAssetEditorManager::Get().GetAllEditedAssets();
1145+
1146+
//UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
1147+
TArray<UObject *> assets = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->GetAllEditedAssets();
11441148
PyObject *assets_list = PyList_New(0);
11451149

11461150
for (UObject *asset : assets)
@@ -1168,7 +1172,9 @@ PyObject *py_unreal_engine_open_editor_for_asset(PyObject * self, PyObject * arg
11681172
if (!u_obj)
11691173
return PyErr_Format(PyExc_Exception, "argument is not a UObject");
11701174

1171-
if (FAssetEditorManager::Get().OpenEditorForAsset(u_obj))
1175+
//UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
1176+
1177+
if (GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->OpenEditorForAsset(u_obj))
11721178
{
11731179
Py_RETURN_TRUE;
11741180
}
@@ -1193,7 +1199,8 @@ PyObject *py_unreal_engine_find_editor_for_asset(PyObject * self, PyObject * arg
11931199
if (py_bool && PyObject_IsTrue(py_bool))
11941200
bFocus = true;
11951201

1196-
IAssetEditorInstance *instance = FAssetEditorManager::Get().FindEditorForAsset(u_obj, bFocus);
1202+
//UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
1203+
IAssetEditorInstance *instance = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->FindEditorForAsset(u_obj, bFocus);
11971204
if (!instance)
11981205
return PyErr_Format(PyExc_Exception, "no editor found for asset");
11991206

@@ -1212,14 +1219,16 @@ PyObject *py_unreal_engine_close_editor_for_asset(PyObject * self, PyObject * ar
12121219
UObject *u_obj = ue_py_check_type<UObject>(py_obj);
12131220
if (!u_obj)
12141221
return PyErr_Format(PyExc_Exception, "argument is not a UObject");
1215-
FAssetEditorManager::Get().CloseAllEditorsForAsset(u_obj);
1222+
1223+
//UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
1224+
GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->CloseAllEditorsForAsset(u_obj);
12161225

12171226
Py_RETURN_NONE;
12181227
}
12191228

12201229
PyObject *py_unreal_engine_close_all_asset_editors(PyObject * self, PyObject * args)
12211230
{
1222-
FAssetEditorManager::Get().CloseAllAssetEditors();
1231+
GEditor->GetEditorSubsystem<UAssetEditorSubsystem>()->CloseAllAssetEditors();
12231232

12241233
Py_RETURN_NONE;
12251234
}
@@ -1355,7 +1364,7 @@ PyObject *py_unreal_engine_reload_blueprint(PyObject * self, PyObject * args)
13551364
UBlueprint *reloaded_bp = nullptr;
13561365

13571366
Py_BEGIN_ALLOW_THREADS
1358-
reloaded_bp = FKismetEditorUtilities::ReloadBlueprint(bp);
1367+
reloaded_bp = FKismetEditorUtilities::ReplaceBlueprint(bp, bp);
13591368
Py_END_ALLOW_THREADS
13601369

13611370
Py_RETURN_UOBJECT(reloaded_bp);

Source/UnrealEnginePython/Private/UEPyModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ static PyObject* py_ue_get_py_proxy(ue_PyUObject* self, PyObject* args)
203203
static PyObject* py_unreal_engine_shutdown(PyObject* self, PyObject* args)
204204
{
205205

206-
GIsRequestingExit = true;
207-
206+
// GIsRequestingExit = true;
207+
RequestEngineExit(FString(TEXT("I'm Shutting Down, Dave...")));
208208
Py_RETURN_NONE;
209209
}
210210

Source/UnrealEnginePython/Private/UObject/UEPyActor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ PyObject *py_ue_actor_create_default_subobject(ue_PyUObject * self, PyObject * a
649649
UObject *ret_obj = nullptr;
650650

651651
Py_BEGIN_ALLOW_THREADS;
652-
ret_obj = actor->CreateDefaultSubobject(FName(UTF8_TO_TCHAR(name)), UObject::StaticClass(), u_class, false, false, true);
652+
ret_obj = actor->CreateDefaultSubobject(FName(UTF8_TO_TCHAR(name)), UObject::StaticClass(), u_class, false, true);
653653
Py_END_ALLOW_THREADS;
654654

655655
if (!ret_obj)

0 commit comments

Comments
 (0)