Skip to content

Commit 30e7232

Browse files
committed
preliminary support for 4.22
1 parent 8b60cca commit 30e7232

File tree

4 files changed

+21
-6
lines changed

4 files changed

+21
-6
lines changed

Source/UnrealEnginePython/Private/Slate/UEPySImage.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55

66
#include "UEPySLeafWidget.h"
77

8+
#if ENGINE_MINOR_VERSION > 21
9+
#include "Runtime/SlateCore/Public/Widgets/Images/SImage.h"
10+
#else
811
#include "Runtime/Slate/Public/Widgets/Images/SImage.h"
12+
#endif
913
#include "Runtime/SlateCore/Public/Styling/SlateBrush.h"
1014

1115
extern PyTypeObject ue_PySImageType;

Source/UnrealEnginePython/Private/UEPyEditor.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ PyObject *py_unreal_engine_editor_play(PyObject * self, PyObject * args)
286286
Py_END_ALLOW_THREADS;
287287

288288
Py_RETURN_NONE;
289-
}
289+
}
290290

291291
PyObject *py_unreal_engine_editor_select_actor(PyObject * self, PyObject * args)
292292
{
@@ -462,7 +462,7 @@ PyObject *py_unreal_engine_import_asset(PyObject * self, PyObject * args)
462462
}
463463

464464
Py_RETURN_NONE;
465-
}
465+
}
466466

467467
PyObject *py_unreal_engine_editor_tick(PyObject * self, PyObject * args)
468468
{
@@ -796,7 +796,7 @@ PyObject *py_unreal_engine_rename_asset(PyObject * self, PyObject * args)
796796
#endif
797797

798798
Py_RETURN_NONE;
799-
}
799+
}
800800

801801
PyObject *py_unreal_engine_duplicate_asset(PyObject * self, PyObject * args)
802802
{
@@ -1879,7 +1879,11 @@ PyObject *py_unreal_engine_editor_on_asset_post_import(PyObject * self, PyObject
18791879
return PyErr_Format(PyExc_Exception, "object is not a callable");
18801880

18811881
TSharedRef<FPythonSmartDelegate> py_delegate = FUnrealEnginePythonHouseKeeper::Get()->NewPythonSmartDelegate(py_callable);
1882+
#if ENGINE_MINOR_VERSION > 21
1883+
GEditor->GetEditorSubsystem<UImportSubsystem>()->OnAssetPostImport.AddSP(py_delegate, &FPythonSmartDelegate::PyFOnAssetPostImport);
1884+
#else
18821885
FEditorDelegates::OnAssetPostImport.AddSP(py_delegate, &FPythonSmartDelegate::PyFOnAssetPostImport);
1886+
#endif
18831887
Py_RETURN_NONE;
18841888
}
18851889

@@ -2115,7 +2119,7 @@ PyObject *py_unreal_engine_add_level_to_world(PyObject *self, PyObject * args)
21152119
#endif
21162120

21172121
Py_RETURN_UOBJECT(level_streaming);
2118-
}
2122+
}
21192123

21202124
PyObject *py_unreal_engine_move_selected_actors_to_level(PyObject *self, PyObject * args)
21212125
{
@@ -2533,7 +2537,11 @@ PyObject *py_unreal_engine_unregister_settings(PyObject * self, PyObject * args)
25332537

25342538
PyObject *py_unreal_engine_all_viewport_clients(PyObject * self, PyObject * args)
25352539
{
2540+
#if ENGINE_MINOR_VERSION > 21
2541+
TArray<FEditorViewportClient *> clients = GEditor->GetAllViewportClients();
2542+
#else
25362543
TArray<FEditorViewportClient *> clients = GEditor->AllViewportClients;
2544+
#endif
25372545
PyObject *py_list = PyList_New(0);
25382546
for (FEditorViewportClient *client : clients)
25392547
{
@@ -2647,5 +2655,6 @@ PyObject *py_unreal_engine_export_assets(PyObject * self, PyObject * args)
26472655

26482656
Py_RETURN_NONE;
26492657
}
2658+
26502659
#endif
26512660

Source/UnrealEnginePython/Private/UObject/UEPyLandscape.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,14 @@ PyObject *py_ue_landscape_export_to_raw_mesh(ue_PyUObject *self, PyObject * args
8585
if (!landscape)
8686
return PyErr_Format(PyExc_Exception, "uobject is not a ULandscapeProxy");
8787

88+
#if ENGINE_MINOR_VERSION > 21
89+
return PyErr_Format(PyExc_Exception, "MeshDescription struct is still unsupported");;
90+
#else
8891
FRawMesh raw_mesh;
8992
if (!landscape->ExportToRawMesh(lod, raw_mesh))
9093
return PyErr_Format(PyExc_Exception, "unable to export landscape to FRawMesh");
9194

9295
return py_ue_new_fraw_mesh(raw_mesh);
96+
#endif
9397
}
9498
#endif

Source/UnrealEnginePython/UnrealEnginePython.Build.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,13 @@ public UnrealEnginePython(TargetInfo Target)
100100

101101
PublicIncludePaths.AddRange(
102102
new string[] {
103-
"UnrealEnginePython/Public",
104103
// ... add public include paths required here ...
105104
}
106105
);
107106

108107

109108
PrivateIncludePaths.AddRange(
110109
new string[] {
111-
"UnrealEnginePython/Private",
112110
// ... add other private include paths required here ...
113111
}
114112
);

0 commit comments

Comments
 (0)