From 2a8ae461a993957795e41322647650f6a8dbce0b Mon Sep 17 00:00:00 2001 From: F0x06 Date: Sat, 4 May 2019 01:29:11 +0200 Subject: [PATCH 1/3] FRotator arguments order should be `pitch` `yaw` `roll` instead of `roll` `pitch` `yaw` --- .../Private/Wrappers/UEPyFRotator.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/UnrealEnginePython/Private/Wrappers/UEPyFRotator.cpp b/Source/UnrealEnginePython/Private/Wrappers/UEPyFRotator.cpp index 3558faa5b..f4b2d35c6 100644 --- a/Source/UnrealEnginePython/Private/Wrappers/UEPyFRotator.cpp +++ b/Source/UnrealEnginePython/Private/Wrappers/UEPyFRotator.cpp @@ -89,8 +89,8 @@ static PyGetSetDef ue_PyFRotator_getseters[] = { static PyObject *ue_PyFRotator_str(ue_PyFRotator *self) { - return PyUnicode_FromFormat("", - PyFloat_FromDouble(self->rot.Roll), PyFloat_FromDouble(self->rot.Pitch), PyFloat_FromDouble(self->rot.Yaw)); + return PyUnicode_FromFormat("", + PyFloat_FromDouble(self->rot.Pitch), PyFloat_FromDouble(self->rot.Yaw), PyFloat_FromDouble(self->rot.Roll)); } PyTypeObject ue_PyFRotatorType = { @@ -211,11 +211,11 @@ static Py_ssize_t ue_py_frotator_seq_length(ue_PyFRotator *self) { static PyObject *ue_py_frotator_seq_item(ue_PyFRotator *self, Py_ssize_t i) { switch (i) { case 0: - return PyFloat_FromDouble(self->rot.Roll); - case 1: return PyFloat_FromDouble(self->rot.Pitch); - case 2: + case 1: return PyFloat_FromDouble(self->rot.Yaw); + case 2: + return PyFloat_FromDouble(self->rot.Roll); } return PyErr_Format(PyExc_IndexError, "FRotator has only 3 items"); } @@ -232,7 +232,7 @@ static int ue_py_frotator_init(ue_PyFRotator *self, PyObject *args, PyObject *kw } } - if (!PyArg_ParseTuple(args, "|fff", &roll, &pitch, &yaw)) + if (!PyArg_ParseTuple(args, "|fff", &pitch, &yaw, &roll)) return -1; if (PyTuple_Size(args) == 1) { @@ -297,7 +297,7 @@ bool py_ue_rotator_arg(PyObject *args, FRotator &rot) { } float pitch, yaw, roll; - if (!PyArg_ParseTuple(args, "fff", &roll, &pitch, &yaw)) + if (!PyArg_ParseTuple(args, "fff", &pitch, &yaw, &roll)) return false; rot.Pitch = pitch; rot.Yaw = yaw; From abbf0747813b27c85ea511b8b3ee421b99b50464 Mon Sep 17 00:00:00 2001 From: F0x06 Date: Sat, 4 May 2019 15:16:43 +0200 Subject: [PATCH 2/3] - Fixed compiler error on `armv7-es2` - Fixed compiler warning (FInputGesture is deprecated) --- Source/UnrealEnginePython/Private/PythonHouseKeeper.cpp | 2 -- Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Source/UnrealEnginePython/Private/PythonHouseKeeper.cpp b/Source/UnrealEnginePython/Private/PythonHouseKeeper.cpp index ea9d5dda3..e4c86d9d2 100644 --- a/Source/UnrealEnginePython/Private/PythonHouseKeeper.cpp +++ b/Source/UnrealEnginePython/Private/PythonHouseKeeper.cpp @@ -1,5 +1,3 @@ -#pragma once - #include "PythonHouseKeeper.h" void FUnrealEnginePythonHouseKeeper::AddReferencedObjects(FReferenceCollector& InCollector) diff --git a/Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp b/Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp index 0cc988240..63194a9a1 100644 --- a/Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp +++ b/Source/UnrealEnginePython/Private/Slate/UEPySlate.cpp @@ -1021,7 +1021,7 @@ class FPythonSlateCommands : public TCommands { commands = MakeShareable(new FUICommandList); - UI_COMMAND_Function(this, command, nullptr, *name, *name, TCHAR_TO_UTF8(*name), *name, *name, EUserInterfaceActionType::Button, FInputGesture()); + UI_COMMAND_Function(this, command, nullptr, *name, *name, TCHAR_TO_UTF8(*name), *name, *name, EUserInterfaceActionType::Button, FInputChord()); commands->MapAction(command, FExecuteAction::CreateRaw(this, &FPythonSlateCommands::Callback), FCanExecuteAction()); } From 0a3c68a93e207262c9be160a39db856fbe176ddd Mon Sep 17 00:00:00 2001 From: F0x06 Date: Mon, 6 May 2019 15:42:44 +0200 Subject: [PATCH 3/3] Added LOCALAPPDATA Python35 detection --- Source/UnrealEnginePython/UnrealEnginePython.Build.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/UnrealEnginePython/UnrealEnginePython.Build.cs b/Source/UnrealEnginePython/UnrealEnginePython.Build.cs index 51394b033..4c6c9e9bf 100644 --- a/Source/UnrealEnginePython/UnrealEnginePython.Build.cs +++ b/Source/UnrealEnginePython/UnrealEnginePython.Build.cs @@ -22,7 +22,8 @@ public class UnrealEnginePython : ModuleRules "C:/Program Files/Python36", "C:/Program Files/Python35", "C:/Python27", - "C:/IntelPython35" + "C:/IntelPython35", + System.Environment.GetEnvironmentVariable("LOCALAPPDATA") + "/Programs/Python/Python35" }; private string[] macKnownPaths =