Skip to content

Commit 734dff3

Browse files
author
Roberto De Ioris
committed
more 4.20 fixes
1 parent 8704fab commit 734dff3

File tree

5 files changed

+38
-6
lines changed

5 files changed

+38
-6
lines changed

Source/UnrealEnginePython/Private/UObject/UEPyCapture.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,10 @@ PyObject *py_unreal_engine_in_editor_capture(PyObject * self, PyObject * args)
344344
}
345345

346346
Py_BEGIN_ALLOW_THREADS
347-
FInEditorMultiCapture::CreateInEditorMultiCapture(Captures);
347+
FInEditorMultiCapture::CreateInEditorMultiCapture(Captures);
348348
Py_END_ALLOW_THREADS
349349

350-
Py_RETURN_NONE;
350+
Py_RETURN_NONE;
351351
}
352352

353353
PyObject *py_ue_set_level_sequence_asset(ue_PyUObject *self, PyObject *args)
@@ -371,8 +371,11 @@ PyObject *py_ue_set_level_sequence_asset(ue_PyUObject *self, PyObject *args)
371371
if (!capture)
372372
return PyErr_Format(PyExc_Exception, "uobject is not a UAutomatedLevelSequenceCapture");
373373

374+
#if ENGINE_MINOR_VERSION < 20
374375
capture->SetLevelSequenceAsset(sequence->GetPathName());
375-
376+
#else
377+
capture->LevelSequenceAsset = FSoftObjectPath(sequence->GetPathName());
378+
#endif
376379
Py_RETURN_NONE;
377380
}
378381
#endif

Source/UnrealEnginePython/Private/UObject/UEPyNavigation.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#include "UEPyNavigation.h"
22

3+
#if ENGINE_MINOR_VERSION < 20
34
#include "AI/Navigation/NavigationSystem.h"
5+
#else
6+
#include "Blueprint/AIBlueprintHelperLibrary.h"
7+
#endif
48
#include "GameFramework/Pawn.h"
59
#include "Engine/World.h"
610

@@ -43,9 +47,12 @@ PyObject *py_ue_simple_move_to_location(ue_PyUObject *self, PyObject * args)
4347
if (!controller)
4448
return PyErr_Format(PyExc_Exception, "Pawn has no controller");
4549

50+
#if ENGINE_MINOR_VERSION < 20
4651
world->GetNavigationSystem()->SimpleMoveToLocation(controller, vec);
52+
#else
53+
UAIBlueprintHelperLibrary::SimpleMoveToLocation(controller, vec);
54+
#endif
4755

48-
Py_INCREF(Py_None);
49-
return Py_None;
56+
Py_RETURN_NONE;
5057
}
5158

Source/UnrealEnginePython/Private/UObject/UEPyObject.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,8 +729,11 @@ PyObject *py_ue_set_property_flags(ue_PyUObject *self, PyObject * args)
729729
if (!u_property)
730730
return PyErr_Format(PyExc_Exception, "unable to find property %s", property_name);
731731

732-
732+
#if ENGINE_MINOR_VERSION < 20
733733
u_property->SetPropertyFlags(flags);
734+
#else
735+
u_property->SetPropertyFlags((EPropertyFlags)flags);
736+
#endif
734737
Py_RETURN_NONE;
735738
}
736739

@@ -762,7 +765,11 @@ PyObject *py_ue_add_property_flags(ue_PyUObject *self, PyObject * args)
762765
return PyErr_Format(PyExc_Exception, "unable to find property %s", property_name);
763766

764767

768+
#if ENGINE_MINOR_VERSION < 20
765769
u_property->SetPropertyFlags(u_property->GetPropertyFlags() | flags);
770+
#else
771+
u_property->SetPropertyFlags(u_property->GetPropertyFlags() | (EPropertyFlags)flags);
772+
#endif
766773
Py_RETURN_NONE;
767774
}
768775

@@ -1503,7 +1510,11 @@ PyObject *py_ue_add_property(ue_PyUObject * self, PyObject * args)
15031510
{
15041511
UArrayProperty *u_array = (UArrayProperty *)scope;
15051512
u_array->AddCppProperty(u_property);
1513+
#if ENGINE_MINOR_VERSION < 20
15061514
u_property->SetPropertyFlags(flags);
1515+
#else
1516+
u_property->SetPropertyFlags((EPropertyFlags)flags);
1517+
#endif
15071518
if (u_property->GetClass() == UObjectProperty::StaticClass())
15081519
{
15091520
UObjectProperty *obj_prop = (UObjectProperty *)u_property;
@@ -1628,7 +1639,11 @@ PyObject *py_ue_add_property(ue_PyUObject * self, PyObject * args)
16281639
}
16291640
}
16301641

1642+
#if ENGINE_MINOR_VERSION < 20
16311643
u_property->SetPropertyFlags(flags);
1644+
#else
1645+
u_property->SetPropertyFlags((EPropertyFlags)flags);
1646+
#endif
16321647
u_property->ArrayDim = 1;
16331648

16341649
UStruct *u_struct = (UStruct *)self->ue_object;

Source/UnrealEnginePython/Private/UObject/UEPySequencer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@
1313
#include "Editor/UnrealEd/Public/Toolkits/AssetEditorManager.h"
1414
#include "Private/LevelSequenceEditorToolkit.h"
1515
#include "Tracks/MovieSceneCameraCutTrack.h"
16+
#if ENGINE_MINOR_VERSION < 20
1617
#include "Sections/IKeyframeSection.h"
18+
#endif
1719
#include "Sections/MovieSceneFloatSection.h"
1820
#include "Sections/MovieSceneBoolSection.h"
1921
#include "Sections/MovieScene3DTransformSection.h"
2022
#include "Sections/MovieSceneVectorSection.h"
2123
#include "Runtime/MovieScene/Public/MovieSceneFolder.h"
2224
#include "Runtime/MovieScene/Public/MovieSceneSpawnable.h"
25+
#include "Runtime/MovieScene/Public/MovieScenePossessable.h"
2326
#if ENGINE_MINOR_VERSION < 18
2427
#include "Editor/UnrealEd/Private/FbxImporter.h"
2528
#else

Source/UnrealEnginePython/Private/Wrappers/UEPyFARFilter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,11 @@ void py_ue_sync_farfilter(PyObject *pyobj)
330330
for (int i = 0; i < (int)pyset_len; i++)
331331
{
332332
py_item = PyList_GetItem(pyset, i);
333+
#if ENGINE_MINOR_VERSION < 20
333334
pyfilter->filter.TagsAndValues.AddUnique(ukey, UTF8_TO_TCHAR(PyUnicode_AsUTF8(py_item)));
335+
#else
336+
pyfilter->filter.TagsAndValues.AddUnique(ukey, FString(UTF8_TO_TCHAR(PyUnicode_AsUTF8(py_item))));
337+
#endif
334338
}
335339
}
336340
}

0 commit comments

Comments
 (0)