Skip to content

Commit bd84b4d

Browse files
author
Roberto De Ioris
committed
first round for 4.20 sull support
1 parent 2951d21 commit bd84b4d

File tree

10 files changed

+33
-10
lines changed

10 files changed

+33
-10
lines changed

Source/UnrealEnginePython/Private/Slate/UEPyFSlateStyleSet.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
#include "UEPyFSlateStyleSet.h"
33
#include "SlateTypes.h"
4+
#include "Runtime/SlateCore/Public/Styling/SlateStyleRegistry.h"
5+
#include "Runtime/SlateCore/Public/Sound/SlateSound.h"
46
#include "Map.h"
57

68
static PyObject *py_ue_fslate_style_set_set_content_root(ue_PyFSlateStyleSet *self, PyObject * args)

Source/UnrealEnginePython/Private/Slate/UEPySNumericEntryBox.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "UEPySCompoundWidget.h"
55

6-
#include "Runtime/Slate/Public/SlateFwd.h"
6+
#include "Runtime/Slate/Public/Widgets/Input/SNumericEntryBox.h"
77

88
extern PyTypeObject ue_PySNumericEntryBoxType;
99

Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108

109109
#include "Runtime/Core/Public/Misc/Attribute.h"
110110
#include "Runtime/Slate/Public/Framework/Application/SlateApplication.h"
111+
#include "Runtime/SlateCore/Public/Styling/SlateStyleRegistry.h"
111112

112113
FReply FPythonSlateDelegate::OnMouseEvent(const FGeometry &geometry, const FPointerEvent &pointer_event)
113114
{

Source/UnrealEnginePython/Private/Slate/UEPySlate.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
#include "UEPyModule.h"
44

5-
#include "SlateBasics.h"
6-
#include "SlateExtras.h"
5+
#include "Runtime/SlateCore/Public/Widgets/DeclarativeSyntaxSupport.h"
76

87

98
#if WITH_EDITOR

Source/UnrealEnginePython/Private/Slate/UEPySlateDelegate.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#pragma once
22

33

4-
#include "SlateBasics.h"
5-
#include "SlateExtras.h"
6-
74
#include "PythonSmartDelegate.h"
85

96
#include "UEPySlatePythonItem.h"

Source/UnrealEnginePython/Private/UEPyAssetUserData.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ PyObject *py_ue_asset_import_data(ue_PyUObject * self, PyObject * args)
2323
PyDict_SetItemString(py_source_file, "absolute_filepath", PyUnicode_FromString(TCHAR_TO_UTF8(*import_data->ResolveImportFilename(import_info->SourceFiles[i].RelativeFilename, NULL))));
2424
PyDict_SetItemString(py_source_file, "relative_filepath", PyUnicode_FromString(TCHAR_TO_UTF8(*import_info->SourceFiles[i].RelativeFilename)));
2525
PyDict_SetItemString(py_source_file, "timestamp", PyLong_FromLong(import_info->SourceFiles[i].Timestamp.ToUnixTimestamp()));
26+
#if ENGINE_MINOR_VERSION > 19
27+
PyDict_SetItemString(py_source_file, "filehash", PyUnicode_FromString(TCHAR_TO_UTF8(*LexToString(import_info->SourceFiles[i].FileHash))));
28+
#else
2629
PyDict_SetItemString(py_source_file, "filehash", PyUnicode_FromString(TCHAR_TO_UTF8(*LexicalConversion::ToString(import_info->SourceFiles[i].FileHash))));
30+
#endif
2731
PyList_SetItem(ret, i, py_source_file);
2832
}
2933
return ret;

Source/UnrealEnginePython/Private/UObject/UEPyCapture.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ for a queue of UMovieSceneCapture objects
2020
#include "Slate/UEPySPythonEditorViewport.h"
2121
#include "GameFramework/GameModeBase.h"
2222
#include "GameFramework/GameMode.h"
23+
#include "Runtime/CoreUObject/Public/Serialization/ObjectReader.h"
24+
#include "Runtime/CoreUObject/Public/Serialization/ObjectWriter.h"
2325

2426

2527
struct FInEditorMultiCapture : TSharedFromThis<FInEditorMultiCapture>

Source/UnrealEnginePython/Private/UObject/UEPySequencer.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,9 @@ PyObject *py_ue_sequencer_section_add_key(ue_PyUObject *self, PyObject * args)
732732
PyObject *f_value = PyNumber_Float(py_value);
733733
float value = PyFloat_AsDouble(f_value);
734734
Py_DECREF(f_value);
735+
#if ENGINE_MINOR_VERSION < 20
735736
section_float->AddKey(time, value, (EMovieSceneKeyInterpolation)interpolation);
737+
#endif
736738
Py_RETURN_NONE;
737739
}
738740
}
@@ -744,7 +746,9 @@ PyObject *py_ue_sequencer_section_add_key(ue_PyUObject *self, PyObject * args)
744746
bool value = false;
745747
if (PyObject_IsTrue(py_value))
746748
value = true;
749+
#if ENGINE_MINOR_VERSION < 20
747750
section_bool->AddKey(time, value, (EMovieSceneKeyInterpolation)interpolation);
751+
#endif
748752
Py_RETURN_NONE;
749753
}
750754
}
@@ -756,6 +760,7 @@ PyObject *py_ue_sequencer_section_add_key(ue_PyUObject *self, PyObject * args)
756760
bool unwind = (py_unwind && PyObject_IsTrue(py_unwind));
757761
FTransform transform = py_transform->transform;
758762

763+
#if ENGINE_MINOR_VERSION < 20
759764
FTransformKey tx = FTransformKey(EKey3DTransformChannel::Translation, EAxis::X, transform.GetLocation().X, unwind);
760765
FTransformKey ty = FTransformKey(EKey3DTransformChannel::Translation, EAxis::Y, transform.GetLocation().Y, unwind);
761766
FTransformKey tz = FTransformKey(EKey3DTransformChannel::Translation, EAxis::Z, transform.GetLocation().Z, unwind);
@@ -777,7 +782,7 @@ PyObject *py_ue_sequencer_section_add_key(ue_PyUObject *self, PyObject * args)
777782
section_transform->AddKey(time, sx, (EMovieSceneKeyInterpolation)interpolation);
778783
section_transform->AddKey(time, sy, (EMovieSceneKeyInterpolation)interpolation);
779784
section_transform->AddKey(time, sz, (EMovieSceneKeyInterpolation)interpolation);
780-
785+
#endif
781786
Py_RETURN_NONE;
782787
}
783788
}
@@ -787,13 +792,16 @@ PyObject *py_ue_sequencer_section_add_key(ue_PyUObject *self, PyObject * args)
787792
if (ue_PyFVector *py_vector = py_ue_is_fvector(py_value))
788793
{
789794
FVector vec = py_vector->vec;
795+
#if ENGINE_MINOR_VERSION < 20
790796
FVectorKey vx = FVectorKey(EKeyVectorChannel::X, vec.X);
791797
FVectorKey vy = FVectorKey(EKeyVectorChannel::Y, vec.Y);
792798
FVectorKey vz = FVectorKey(EKeyVectorChannel::Z, vec.Z);
793799

800+
794801
section_vector->AddKey(time, vx, (EMovieSceneKeyInterpolation)interpolation);
795802
section_vector->AddKey(time, vy, (EMovieSceneKeyInterpolation)interpolation);
796803
section_vector->AddKey(time, vz, (EMovieSceneKeyInterpolation)interpolation);
804+
#endif
797805

798806
Py_RETURN_NONE;
799807
}
@@ -1102,9 +1110,11 @@ PyObject *py_ue_sequencer_import_fbx_transform(ue_PyUObject *self, PyObject * ar
11021110
{
11031111
ChannelAxis = EAxis::Z;
11041112
}
1113+
#if ENGINE_MINOR_VERSION < 20
11051114
section->GetTranslationCurve(ChannelAxis).SetDefaultValue(DefaultTransform.GetLocation()[ChannelIndex]);
11061115
section->GetRotationCurve(ChannelAxis).SetDefaultValue(DefaultTransform.GetRotation().Euler()[ChannelIndex]);
11071116
section->GetScaleCurve(ChannelAxis).SetDefaultValue(DefaultTransform.GetScale3D()[ChannelIndex]);
1117+
#endif
11081118
}
11091119
#else
11101120
CurveAPI.GetConvertedTransformCurveData(NodeName, Translation[0], Translation[1], Translation[2], EulerRotation[0], EulerRotation[1], EulerRotation[2], Scale[0], Scale[1], Scale[2]);
@@ -1136,7 +1146,9 @@ PyObject *py_ue_sequencer_import_fbx_transform(ue_PyUObject *self, PyObject * ar
11361146
if (CurveIndex == 0)
11371147
{
11381148
CurveFloat = &Translation[ChannelIndex];
1149+
#if ENGINE_MINOR_VERSION < 20
11391150
ChannelCurve = &section->GetTranslationCurve(ChannelAxis);
1151+
#endif
11401152
if (ChannelIndex == 1)
11411153
{
11421154
bNegative = true;
@@ -1145,7 +1157,9 @@ PyObject *py_ue_sequencer_import_fbx_transform(ue_PyUObject *self, PyObject * ar
11451157
else if (CurveIndex == 1)
11461158
{
11471159
CurveFloat = &EulerRotation[ChannelIndex];
1160+
#if ENGINE_MINOR_VERSION < 20
11481161
ChannelCurve = &section->GetRotationCurve(ChannelAxis);
1162+
#endif
11491163
if (ChannelIndex == 1 || ChannelIndex == 2)
11501164
{
11511165
bNegative = true;
@@ -1154,7 +1168,9 @@ PyObject *py_ue_sequencer_import_fbx_transform(ue_PyUObject *self, PyObject * ar
11541168
else if (CurveIndex == 2)
11551169
{
11561170
CurveFloat = &Scale[ChannelIndex];
1171+
#if ENGINE_MINOR_VERSION < 20
11571172
ChannelCurve = &section->GetScaleCurve(ChannelAxis);
1173+
#endif
11581174
}
11591175

11601176
if (ChannelCurve != nullptr && CurveFloat != nullptr)
@@ -1184,7 +1200,9 @@ PyObject *py_ue_sequencer_import_fbx_transform(ue_PyUObject *self, PyObject * ar
11841200
LeaveTangent = -LeaveTangent;
11851201
}
11861202

1203+
#if ENGINE_MINOR_VERSION < 20
11871204
FMatineeImportTools::SetOrAddKey(*ChannelCurve, CurveFloat->Points[KeyIndex].InVal, CurveFloat->Points[KeyIndex].OutVal, ArriveTangent, LeaveTangent, CurveFloat->Points[KeyIndex].InterpMode);
1205+
#endif
11881206
}
11891207

11901208
ChannelCurve->RemoveRedundantKeys(KINDA_SMALL_NUMBER);
@@ -1193,8 +1211,10 @@ PyObject *py_ue_sequencer_import_fbx_transform(ue_PyUObject *self, PyObject * ar
11931211
}
11941212
}
11951213

1214+
#if ENGINE_MINOR_VERSION < 20
11961215
section->SetStartTime(MinTime);
11971216
section->SetEndTime(MaxTime);
1217+
#endif
11981218

11991219
FbxImporter->ReleaseScene();
12001220
ImportOptions->bConvertScene = bConverteScene;

Source/UnrealEnginePython/Public/UnrealEnginePython.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99

1010
//#define UEPY_MEMORY_DEBUG 1
1111

12-
13-
14-
1512
#include "CoreMinimal.h"
1613
#include "ModuleManager.h"
1714
#include "Styling/SlateStyle.h"

Source/UnrealEnginePython/UnrealEnginePython.Build.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public UnrealEnginePython(TargetInfo Target)
144144
"MovieSceneCapture",
145145
"Landscape",
146146
"Foliage",
147+
"AIModule"
147148
// ... add private dependencies that you statically link with here ...
148149
}
149150
);

0 commit comments

Comments
 (0)