Skip to content

Commit 68e14dc

Browse files
author
Roberto De Ioris
committed
support for 4.13
1 parent 9877aba commit 68e14dc

7 files changed

Lines changed: 23 additions & 1 deletion

File tree

‎Source/UnrealEnginePython/Private/Slate/UEPySObjectPropertyEntryBox.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ static int ue_py_sobject_property_entry_box_init(ue_PySObjectPropertyEntryBox *s
4747
ue_py_slate_farguments_optional_bool("allow_clear", AllowClear);
4848
ue_py_slate_farguments_optional_bool("display_browse", DisplayBrowse);
4949
ue_py_slate_farguments_optional_bool("display_use_selected", DisplayUseSelected);
50+
#if ENGINE_MINOR_VERSION > 13
5051
ue_py_slate_farguments_optional_bool("enable_content_picker", EnableContentPicker);
52+
#endif
5153
ue_py_slate_farguments_string("object_path", ObjectPath);
5254

5355
ue_py_slate_farguments_optional_uobject("allowed_class", AllowedClass, UClass);

‎Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
#include "LevelEditor.h"
66
#include "Editor/UnrealEd/Public/Toolkits/AssetEditorToolkit.h"
77
#include "Editor/Persona/Public/PersonaModule.h"
8+
#if ENGINE_MINOR_VERSION > 13
89
#include "Editor/AnimationEditor/Public/IAnimationEditorModule.h"
10+
#endif
911
#include "Editor/StaticMeshEditor/Public/StaticMeshEditorModule.h"
1012
#include "Editor/PropertyEditor/Public/PropertyEditorModule.h"
1113
#include "Editor/PropertyEditor/Public/ISinglePropertyView.h"
@@ -838,10 +840,12 @@ PyObject *py_unreal_engine_add_menu_extension(PyObject * self, PyObject * args)
838840
FPersonaModule &Module = FModuleManager::LoadModuleChecked<FPersonaModule>(module);
839841
menu_extension_interface = (IHasMenuExtensibility *)&Module;
840842
}
843+
#if ENGINE_MINOR_VERSION > 13
841844
else if (!strcmp(module, (char *)"AnimationEditor")) {
842845
IAnimationEditorModule &Module = FModuleManager::LoadModuleChecked<IAnimationEditorModule>(module);
843846
menu_extension_interface = (IHasMenuExtensibility *)&Module;
844847
}
848+
#endif
845849
else if (!strcmp(module, (char *)"StaticMeshEditor")) {
846850
IStaticMeshEditorModule &Module = FModuleManager::LoadModuleChecked<IStaticMeshEditorModule>(module);
847851
menu_extension_interface = (IHasMenuExtensibility *)&Module;

‎Source/UnrealEnginePython/Private/UEPyModule.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,11 @@ static PyMethodDef ue_PyUObject_methods[] = {
483483
{ "anim_set_skeleton", (PyCFunction)py_ue_anim_set_skeleton, METH_VARARGS, "" },
484484

485485
#if WITH_EDITOR
486+
#if ENGINE_MINOR_VERSION > 13
486487
{ "get_raw_animation_data", (PyCFunction)py_ue_anim_sequence_get_raw_animation_data, METH_VARARGS, "" },
487488
{ "get_raw_animation_track", (PyCFunction)py_ue_anim_sequence_get_raw_animation_track, METH_VARARGS, "" },
488489
{ "add_new_raw_track", (PyCFunction)py_ue_anim_sequence_add_new_raw_track, METH_VARARGS, "" },
490+
#endif
489491
{ "add_anim_composite_section", (PyCFunction)py_ue_add_anim_composite_section, METH_VARARGS, "" },
490492
#endif
491493

@@ -690,7 +692,9 @@ static PyMethodDef ue_PyUObject_methods[] = {
690692
{ "skeleton_find_bone_index", (PyCFunction)py_ue_skeleton_find_bone_index, METH_VARARGS, "" },
691693
{ "skeleton_get_ref_bone_pose", (PyCFunction)py_ue_skeleton_get_ref_bone_pose, METH_VARARGS, "" },
692694

695+
#if ENGINE_MINOR_VERSION > 13
693696
{ "skeleton_add_bone", (PyCFunction)py_ue_skeleton_add_bone, METH_VARARGS, "" },
697+
#endif
694698

695699
{ "skeletal_mesh_set_soft_vertices", (PyCFunction)py_ue_skeletal_mesh_set_soft_vertices, METH_VARARGS, "" },
696700
{ "skeletal_mesh_get_soft_vertices", (PyCFunction)py_ue_skeletal_mesh_get_soft_vertices, METH_VARARGS, "" },

‎Source/UnrealEnginePython/Private/UObject/UEPyAnimSequence.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ PyObject *py_ue_anim_get_skeleton(ue_PyUObject * self, PyObject * args) {
2424

2525

2626
#if WITH_EDITOR
27+
#if ENGINE_MINOR_VERSION > 13
2728
PyObject *py_ue_anim_sequence_get_raw_animation_data(ue_PyUObject * self, PyObject * args) {
2829
ue_py_check(self);
2930

@@ -95,6 +96,7 @@ PyObject *py_ue_anim_sequence_add_new_raw_track(ue_PyUObject * self, PyObject *
9596
return PyLong_FromLong(index);
9697
}
9798
#endif
99+
#endif
98100

99101
PyObject *py_ue_anim_set_skeleton(ue_PyUObject * self, PyObject * args) {
100102
ue_py_check(self);

‎Source/UnrealEnginePython/Private/UObject/UEPySkeletal.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ PyObject *py_ue_skeleton_get_ref_bone_pose(ue_PyUObject *self, PyObject * args)
138138
return py_ue_new_ftransform(skeleton->GetReferenceSkeleton().GetRefBonePose()[index]);
139139
}
140140

141+
#if ENGINE_MINOR_VERSION > 13
141142
PyObject *py_ue_skeleton_add_bone(ue_PyUObject *self, PyObject * args) {
142143

143144
ue_py_check(self);
@@ -178,6 +179,7 @@ PyObject *py_ue_skeleton_add_bone(ue_PyUObject *self, PyObject * args) {
178179

179180
Py_RETURN_NONE;
180181
}
182+
#endif
181183

182184
PyObject *py_ue_skeletal_mesh_set_soft_vertices(ue_PyUObject *self, PyObject * args) {
183185
ue_py_check(self);

‎Source/UnrealEnginePython/Private/UnrealEnginePython.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ void FUnrealEnginePythonModule::StartupModule()
227227
StyleSet->SetContentRoot(IPluginManager::Get().FindPlugin("UnrealEnginePython")->GetBaseDir() / "Resources");
228228
StyleSet->Set("ClassThumbnail.PythonScript", new FSlateImageBrush(StyleSet->RootToContentDir("Icon128.png"), FVector2D(128.0f, 128.0f)));
229229
FSlateStyleRegistry::RegisterSlateStyle(*StyleSet.Get());
230-
#if ENGINE_MINOR_VERSION == 13
230+
#if ENGINE_MINOR_VERSION < 13
231231
FClassIconFinder::RegisterIconSource(StyleSet.Get());
232232
#endif
233233
#endif

‎Source/UnrealEnginePython/Private/Wrappers/UEPyFStringAssetReference.cpp‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
#include "UEPyFStringAssetReference.h"
44

55
static PyObject *py_ue_fstring_asset_reference_get_asset_name(ue_PyFStringAssetReference *self, PyObject * args) {
6+
#if ENGINE_MINOR_VERSION > 13
67
return PyUnicode_FromString(TCHAR_TO_UTF8(*self->fstring_asset_reference.GetAssetName()));
8+
#else
9+
return PyUnicode_FromString(TCHAR_TO_UTF8(*FPackageName::ObjectPathToObjectName(self->fstring_asset_reference.AssetLongPathname)));
10+
#endif
711
}
812

913
static PyObject *py_ue_fstring_asset_reference_get_long_package_name(ue_PyFStringAssetReference *self, PyObject * args) {
@@ -20,7 +24,11 @@ static PyMethodDef ue_PyFStringAssetReference_methods[] = {
2024
static PyObject *ue_PyFStringAssetReference_str(ue_PyFStringAssetReference *self)
2125
{
2226
return PyUnicode_FromFormat("<unreal_engine.FStringAssetReference {'asset_name': %s}>",
27+
#if ENGINE_MINOR_VERSION > 13
2328
TCHAR_TO_UTF8(*self->fstring_asset_reference.GetAssetName()));
29+
#else
30+
TCHAR_TO_UTF8(*FPackageName::ObjectPathToObjectName(self->fstring_asset_reference.AssetLongPathname)));
31+
#endif
2432
}
2533

2634
static PyTypeObject ue_PyFStringAssetReferenceType = {

0 commit comments

Comments
 (0)