Skip to content

Commit 4ad30a9

Browse files
committed
Support UE4.27
1 parent 319059a commit 4ad30a9

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

Source/UnrealEnginePython/Private/Http/UEPyIHttpRequest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ static int ue_py_ihttp_request_init(ue_PyIHttpRequest *self, PyObject *args, PyO
307307
{
308308
return -1;
309309
}
310-
new(&self->http_request) TSharedRef<IHttpRequest>(FHttpModule::Get().CreateRequest());
310+
new(&self->http_request) TSharedRef<IHttpRequest, ESPMode::ThreadSafe>(FHttpModule::Get().CreateRequest());
311311
new(&self->on_process_request_complete) TSharedPtr<FPythonSmartHttpDelegate>(nullptr);
312312
new(&self->on_request_progress) TSharedPtr<FPythonSmartHttpDelegate>(nullptr);
313313
self->py_dict = PyDict_New();

Source/UnrealEnginePython/Private/Slate/UEPySCheckBox.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static int ue_py_scheck_box_init(ue_PySCheckBox *self, PyObject *args, PyObject
103103
ue_py_slate_farguments_enum("is_checked", IsChecked, ECheckBoxState);
104104
ue_py_slate_farguments_optional_enum("h_align", HAlign, EHorizontalAlignment);
105105
ue_py_slate_farguments_struct("padding", Padding, FMargin);
106-
ue_py_slate_farguments_enum("click_method", ClickMethod, EButtonClickMethod::Type);
106+
ue_py_slate_farguments_optional_enum("click_method", ClickMethod, EButtonClickMethod::Type);
107107
ue_py_slate_farguments_optional_bool("is_focusable", IsFocusable);
108108
ue_py_slate_farguments_optional_struct_ptr("unchecked_image", UncheckedImage, FSlateBrush);
109109
ue_py_slate_farguments_optional_struct_ptr("unchecked_hoveredimage", UncheckedHoveredImage, FSlateBrush);

Source/UnrealEnginePython/Private/UEPyEngine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ PyObject *py_unreal_engine_object_path_to_package_name(PyObject * self, PyObject
215215
{
216216
return NULL;
217217
}
218-
return PyUnicode_FromString(TCHAR_TO_UTF8(*FPackageName::ObjectPathToPackageName(UTF8_TO_TCHAR(path))));
218+
return PyUnicode_FromString(TCHAR_TO_UTF8(*FPackageName::ObjectPathToPackageName(FString(UTF8_TO_TCHAR(path)))));
219219
}
220220

221221
PyObject *py_unreal_engine_get_path(PyObject * self, PyObject * args)

Source/UnrealEnginePython/Private/UObject/UEPyObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2784,7 +2784,7 @@ PyObject *py_ue_save_package(ue_PyUObject * self, PyObject * args)
27842784
}
27852785
}
27862786
// create a new package if it does not exist
2787-
package = CreatePackage(nullptr, UTF8_TO_TCHAR(name));
2787+
package = CreatePackage(UTF8_TO_TCHAR(name));
27882788
if (!package)
27892789
return PyErr_Format(PyExc_Exception, "unable to create package");
27902790

Source/UnrealEnginePython/Private/UObject/UEPySkeletal.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ PyObject *py_ue_skeletal_mesh_set_soft_vertices(ue_PyUObject *self, PyObject * a
270270
model.Sections[section_index].NumVertices = soft_vertices.Num();
271271
model.Sections[section_index].CalcMaxBoneInfluences();
272272

273-
mesh->RefBasesInvMatrix.Empty();
273+
mesh->GetRefBasesInvMatrix().Empty();
274274
mesh->CalculateInvRefMatrices();
275275

276276
#if WITH_EDITOR
@@ -468,11 +468,11 @@ PyObject *py_ue_skeletal_mesh_set_skeleton(ue_PyUObject * self, PyObject * args)
468468
mesh->ReleaseResources();
469469
mesh->ReleaseResourcesFence.Wait();
470470

471-
mesh->Skeleton = skeleton;
471+
mesh->SetSkeleton(skeleton);
472472

473-
mesh->RefSkeleton = skeleton->GetReferenceSkeleton();
473+
mesh->GetRefSkeleton() = skeleton->GetReferenceSkeleton();
474474

475-
mesh->RefBasesInvMatrix.Empty();
475+
mesh->GetRefBasesInvMatrix().Empty();
476476
mesh->CalculateInvRefMatrices();
477477

478478
#if WITH_EDITOR
@@ -548,7 +548,7 @@ PyObject *py_ue_skeletal_mesh_set_bone_map(ue_PyUObject *self, PyObject * args)
548548

549549
model.Sections[section_index].BoneMap = bone_map;
550550

551-
mesh->RefBasesInvMatrix.Empty();
551+
mesh->GetRefBasesInvMatrix().Empty();
552552
mesh->CalculateInvRefMatrices();
553553

554554
#if WITH_EDITOR
@@ -701,7 +701,7 @@ PyObject *py_ue_skeletal_mesh_set_active_bone_indices(ue_PyUObject *self, PyObje
701701
model.ActiveBoneIndices = active_indices;
702702
model.ActiveBoneIndices.Sort();
703703

704-
mesh->RefBasesInvMatrix.Empty();
704+
mesh->GetRefBasesInvMatrix().Empty();
705705
mesh->CalculateInvRefMatrices();
706706

707707
#if WITH_EDITOR
@@ -810,7 +810,7 @@ PyObject *py_ue_skeletal_mesh_set_required_bones(ue_PyUObject *self, PyObject *
810810
model.RequiredBones = required_bones;
811811
model.RequiredBones.Sort();
812812

813-
mesh->RefBasesInvMatrix.Empty();
813+
mesh->GetRefBasesInvMatrix().Empty();
814814
mesh->CalculateInvRefMatrices();
815815

816816
#if WITH_EDITOR
@@ -1065,7 +1065,7 @@ PyObject *py_ue_skeletal_mesh_build_lod(ue_PyUObject *self, PyObject * args, PyO
10651065
build_settings.bComputeTangents = (py_compute_tangents && PyObject_IsTrue(py_compute_tangents));
10661066
build_settings.bRemoveDegenerateTriangles = true;
10671067

1068-
bool success = MeshUtilities.BuildSkeletalMesh(lod_model, mesh->RefSkeleton, influences, wedges, faces, points, points_to_map, build_settings);
1068+
bool success = MeshUtilities.BuildSkeletalMesh(lod_model, mesh->GetPathName(), mesh->GetRefSkeleton(), influences, wedges, faces, points, points_to_map, build_settings);
10691069

10701070
if (!success)
10711071
{
@@ -1079,17 +1079,17 @@ PyObject *py_ue_skeletal_mesh_build_lod(ue_PyUObject *self, PyObject * args, PyO
10791079
}
10801080
#endif
10811081

1082-
mesh->CalculateRequiredBones(LODModel, mesh->RefSkeleton, nullptr);
1082+
mesh->CalculateRequiredBones(LODModel, mesh->GetRefSkeleton(), nullptr);
10831083
mesh->CalculateInvRefMatrices();
10841084

1085-
mesh->Skeleton->RecreateBoneTree(mesh);
1086-
mesh->Skeleton->SetPreviewMesh(mesh);
1085+
mesh->GetSkeleton()->RecreateBoneTree(mesh);
1086+
mesh->GetSkeleton()->SetPreviewMesh(mesh);
10871087

10881088
// calculate bounds from points
10891089
mesh->SetImportedBounds(FBoxSphereBounds(points.GetData(), points.Num()));
10901090

1091-
mesh->Skeleton->PostEditChange();
1092-
mesh->Skeleton->MarkPackageDirty();
1091+
mesh->GetSkeleton()->PostEditChange();
1092+
mesh->GetSkeleton()->MarkPackageDirty();
10931093

10941094
mesh->PostEditChange();
10951095
mesh->MarkPackageDirty();

Source/UnrealEnginePython/Private/Voice/UEPyIVoiceCapture.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static PyTypeObject ue_PyIVoiceCaptureType = {
131131
static int py_ue_ivoice_capture_init(ue_PyIVoiceCapture *self, PyObject * args)
132132
{
133133

134-
TSharedPtr<IVoiceCapture> voice_capture_ptr = FVoiceModule::Get().CreateVoiceCapture();
134+
TSharedPtr<IVoiceCapture> voice_capture_ptr = FVoiceModule::Get().CreateVoiceCapture("");
135135
if (!voice_capture_ptr.IsValid())
136136
{
137137
PyErr_SetString(PyExc_Exception, "unable to create a new VoiceCapture");

Source/UnrealEnginePython/Private/Wrappers/UEPyFAssetData.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ static PyObject *py_ue_fassetdata_get_tags_and_values(ue_PyFAssetData *self, voi
122122
for (auto It = self->asset_data.TagsAndValues.CreateConstIterator(); It; ++It)
123123
{
124124
PyDict_SetItem(ret,
125-
PyUnicode_FromString(TCHAR_TO_UTF8(*It->Key.ToString())),
126-
PyUnicode_FromString(TCHAR_TO_UTF8(*It->Value)));
125+
PyUnicode_FromString(TCHAR_TO_UTF8(*It.Key().ToString())),
126+
PyUnicode_FromString(TCHAR_TO_UTF8(*It.Value().AsString())));
127127
}
128128
return ret;
129129
}

Source/UnrealEnginePython/Public/UnrealEnginePython.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
#include <Python.h>
3737
#include <structmember.h>
3838
#elif PLATFORM_WINDOWS
39-
#include <include/pyconfig.h>
39+
#include <Python3/Win64/include/pyconfig.h>
4040
#ifndef SIZEOF_PID_T
4141
#define SIZEOF_PID_T 4
4242
#endif
43-
#include <include/Python.h>
44-
#include <include/structmember.h>
43+
#include <Python3/Win64/include/Python.h>
44+
#include <Python3/Win64/include/structmember.h>
4545
#endif
4646

4747
typedef struct

0 commit comments

Comments
 (0)