Skip to content

Commit

Permalink
- fixe for Unreal Engine 4.27
Browse files Browse the repository at this point in the history
TODO:
- can't fix 2 functions:
- UEPySequencer.cpp ->
	// commented out for now
	MovieSceneToolHelpers::CameraAdded(OwnerMovieScene, CameraGuid, sequencer->GetLocalTime().Time.FloorToFrame());

- UEPySCheckBox.cpp
	// commented out
	ue_py_slate_farguments_enum("click_method", ClickMethod, EButtonClickMethod::Type);
  • Loading branch information
giwig committed Aug 28, 2021
1 parent b77c30e commit 6c589b0
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 10 deletions.
4 changes: 3 additions & 1 deletion Source/UnrealEnginePython/Private/Http/UEPyIHttpRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "UEPyIHttpResponse.h"

#include "Runtime/Online/HTTP/Public/HttpManager.h"
#include "Runtime/Online/HTTP/Public/HttpModule.h"

static PyObject *py_ue_ihttp_request_set_verb(ue_PyIHttpRequest *self, PyObject * args)
{
Expand Down Expand Up @@ -307,7 +308,8 @@ static int ue_py_ihttp_request_init(ue_PyIHttpRequest *self, PyObject *args, PyO
{
return -1;
}
new(&self->http_request) TSharedRef<IHttpRequest>(FHttpModule::Get().CreateRequest());
new(&self->http_request) TSharedRef<IHttpRequest, ESPMode::ThreadSafe>(FHttpModule::Get().CreateRequest());
//new(&self->http_request) TSharedRef<IHttpRequest>(FHttpModule::Get().CreateRequest());
new(&self->on_process_request_complete) TSharedPtr<FPythonSmartHttpDelegate>(nullptr);
new(&self->on_request_progress) TSharedPtr<FPythonSmartHttpDelegate>(nullptr);
self->py_dict = PyDict_New();
Expand Down
4 changes: 3 additions & 1 deletion Source/UnrealEnginePython/Private/Slate/UEPySCheckBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ static int ue_py_scheck_box_init(ue_PySCheckBox *self, PyObject *args, PyObject
ue_py_slate_farguments_enum("is_checked", IsChecked, ECheckBoxState);
ue_py_slate_farguments_optional_enum("h_align", HAlign, EHorizontalAlignment);
ue_py_slate_farguments_struct("padding", Padding, FMargin);
ue_py_slate_farguments_enum("click_method", ClickMethod, EButtonClickMethod::Type);

//ue_py_slate_farguments_enum("click_method", ClickMethod, EButtonClickMethod::Type);

ue_py_slate_farguments_optional_bool("is_focusable", IsFocusable);
ue_py_slate_farguments_optional_struct_ptr("unchecked_image", UncheckedImage, FSlateBrush);
ue_py_slate_farguments_optional_struct_ptr("unchecked_hoveredimage", UncheckedHoveredImage, FSlateBrush);
Expand Down
2 changes: 1 addition & 1 deletion Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,7 @@ PyObject *py_unreal_engine_invoke_tab(PyObject * self, PyObject * args)
return NULL;
}

FGlobalTabmanager::Get()->InvokeTab(FTabId(FName(UTF8_TO_TCHAR(name))));
FGlobalTabmanager::Get()->TryInvokeTab(FTabId(FName(UTF8_TO_TCHAR(name))));

Py_INCREF(Py_None);
return Py_None;
Expand Down
2 changes: 1 addition & 1 deletion Source/UnrealEnginePython/Private/UEPyEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ PyObject *py_unreal_engine_object_path_to_package_name(PyObject * self, PyObject
{
return NULL;
}
return PyUnicode_FromString(TCHAR_TO_UTF8(*FPackageName::ObjectPathToPackageName(UTF8_TO_TCHAR(path))));
return PyUnicode_FromString(TCHAR_TO_UTF8(*FPackageName::ObjectPathToPackageName( FString( UTF8_TO_TCHAR(path)))));
}

PyObject *py_unreal_engine_get_path(PyObject * self, PyObject * args)
Expand Down
3 changes: 2 additions & 1 deletion Source/UnrealEnginePython/Private/UObject/UEPyObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2784,7 +2784,8 @@ PyObject *py_ue_save_package(ue_PyUObject * self, PyObject * args)
}
}
// create a new package if it does not exist
package = CreatePackage(nullptr, UTF8_TO_TCHAR(name));
//package = CreatePackage(nullptr, UTF8_TO_TCHAR(name));
package = CreatePackage(UTF8_TO_TCHAR(name));
if (!package)
return PyErr_Format(PyExc_Exception, "unable to create package");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ PyObject *py_ue_sequencer_add_camera(ue_PyUObject *self, PyObject * args)
UMovieSceneSequence* Sequence = sequencer->GetFocusedMovieSceneSequence();
UMovieScene* OwnerMovieScene = Sequence->GetMovieScene();

MovieSceneToolHelpers::CameraAdded(OwnerMovieScene, CameraGuid, sequencer->GetLocalTime().Time.FloorToFrame());
//MovieSceneToolHelpers::CameraAdded(OwnerMovieScene, CameraGuid, sequencer->GetLocalTime().Time.FloorToFrame());

}
#else
Expand Down
3 changes: 2 additions & 1 deletion Source/UnrealEnginePython/Private/UObject/UEPySkeletal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,8 @@ PyObject *py_ue_skeletal_mesh_build_lod(ue_PyUObject *self, PyObject * args, PyO
build_settings.bComputeTangents = (py_compute_tangents && PyObject_IsTrue(py_compute_tangents));
build_settings.bRemoveDegenerateTriangles = true;

bool success = MeshUtilities.BuildSkeletalMesh(lod_model, mesh->RefSkeleton, influences, wedges, faces, points, points_to_map, build_settings);
//bool success = MeshUtilities.BuildSkeletalMesh(lod_model, mesh->RefSkeleton, influences, wedges, faces, points, points_to_map, build_settings);
bool success = MeshUtilities.BuildSkeletalMesh(lod_model, mesh->GetName(), mesh->GetRefSkeleton(), influences, wedges, faces, points, points_to_map, build_settings);

if (!success)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ static PyTypeObject ue_PyIVoiceCaptureType = {
static int py_ue_ivoice_capture_init(ue_PyIVoiceCapture *self, PyObject * args)
{

TSharedPtr<IVoiceCapture> voice_capture_ptr = FVoiceModule::Get().CreateVoiceCapture();
TSharedPtr<IVoiceCapture> voice_capture_ptr = FVoiceModule::Get().CreateVoiceCapture("", 32000, 16);
if (!voice_capture_ptr.IsValid())
{
PyErr_SetString(PyExc_Exception, "unable to create a new VoiceCapture");
Expand Down
4 changes: 2 additions & 2 deletions Source/UnrealEnginePython/Private/Wrappers/UEPyFAssetData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ static PyObject *py_ue_fassetdata_get_tags_and_values(ue_PyFAssetData *self, voi
for (auto It = self->asset_data.TagsAndValues.CreateConstIterator(); It; ++It)
{
PyDict_SetItem(ret,
PyUnicode_FromString(TCHAR_TO_UTF8(*It->Key.ToString())),
PyUnicode_FromString(TCHAR_TO_UTF8(*It->Value)));
PyUnicode_FromString(TCHAR_TO_UTF8(*It.Key().ToString())),
PyUnicode_FromString(TCHAR_TO_UTF8(*It.Value().AsString() )));
}
return ret;
}
Expand Down

0 comments on commit 6c589b0

Please sign in to comment.