Skip to content

Commit ed3499c

Browse files
author
David
committed
More non-FProperty updates from Support4.25 pull request patched in.
1 parent e3ebc3a commit ed3499c

4 files changed

Lines changed: 47 additions & 6 deletions

File tree

Source/UnrealEnginePython/Private/UObject/UEPyCapture.cpp

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,16 @@ struct FInEditorMultiCapture : TSharedFromThis<FInEditorMultiCapture>
118118
UGameViewportClient::OnViewportCreated().AddRaw(this, &FInEditorMultiCapture::OnStart);
119119
FEditorDelegates::EndPIE.AddRaw(this, &FInEditorMultiCapture::OnEndPIE);
120120

121-
FAudioDevice* AudioDevice = GEngine->GetMainAudioDevice();
122-
if (AudioDevice != nullptr)
121+
//Use auto because UE4.25 changed type, but type has same interface
122+
auto AudioDevice = GEngine->GetMainAudioDevice();
123+
124+
#if ENGINE_MINOR_VERSION >= 25
125+
bool bIsDeviceValid = AudioDevice.IsValid();
126+
#else
127+
bool bIsDeviceValid = (AudioDevice != nullptr);
128+
#endif
129+
130+
if (bIsDeviceValid)
123131
{
124132
TransientMasterVolume = AudioDevice->GetTransientMasterVolume();
125133
AudioDevice->SetTransientMasterVolume(0.0f);
@@ -278,8 +286,16 @@ struct FInEditorMultiCapture : TSharedFromThis<FInEditorMultiCapture>
278286

279287
FObjectReader(GetMutableDefault<ULevelEditorPlaySettings>(), BackedUpPlaySettings);
280288

281-
FAudioDevice* AudioDevice = GEngine->GetMainAudioDevice();
282-
if (AudioDevice != nullptr)
289+
//Use auto because UE4.25 changed type, but type has same interface
290+
auto AudioDevice = GEngine->GetMainAudioDevice();
291+
292+
#if ENGINE_MINOR_VERSION >= 25
293+
bool bIsDeviceValid = AudioDevice.IsValid();
294+
#else
295+
bool bIsDeviceValid = (AudioDevice != nullptr);
296+
#endif
297+
298+
if (bIsDeviceValid)
283299
{
284300
AudioDevice->SetTransientMasterVolume(TransientMasterVolume);
285301
}

Source/UnrealEnginePython/Private/Wrappers/UEPyFEditorViewportClient.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,24 @@ static PyObject *py_ue_feditor_viewport_client_set_realtime(ue_PyFEditorViewport
105105
if (!PyArg_ParseTuple(args, "OO", &bInRealtime, &bStoreCurrentValue))
106106
return nullptr;
107107

108+
#if ENGINE_MINOR_VERSION >= 25
109+
// UE4.25 split this setting to 2 separate functions
110+
if (PyObject_IsTrue(bStoreCurrentValue))
111+
{
112+
//Persist across editor sessions
113+
self->editor_viewport_client->SetRealtime(PyObject_IsTrue(bInRealtime) ? true : false);
114+
}
115+
else
116+
{
117+
//Don't persist across editor sessions
118+
FText OverrideSourceText;
119+
OverrideSourceText.FromString(TEXT("UnrealEnginePython plugin script"));
120+
self->editor_viewport_client->SetRealtimeOverride(PyObject_IsTrue(bInRealtime) ? true : false, OverrideSourceText);
121+
}
122+
#else
108123
self->editor_viewport_client->SetRealtime(PyObject_IsTrue(bInRealtime) ? true : false,
109124
PyObject_IsTrue(bStoreCurrentValue) ? true : false);
125+
#endif
110126
Py_RETURN_NONE;
111127
}
112128

@@ -195,4 +211,4 @@ PyObject *py_ue_new_feditor_viewport_client(TSharedRef<FEditorViewportClient> ed
195211
new(&ret->editor_viewport_client) TSharedRef<FEditorViewportClient>(editor_viewport_client);
196212
return (PyObject *)ret;
197213
}
198-
#endif
214+
#endif

Source/UnrealEnginePython/Private/Wrappers/UEPyFRawMesh.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55

66
#if ENGINE_MINOR_VERSION > 13
77

8+
#if ENGINE_MINOR_VERSION < 25
89
#include "Developer/RawMesh/Public/RawMesh.h"
10+
#else
11+
#include "Runtime/RawMesh/Public/RawMesh.h"
12+
#endif
13+
914

1015
struct ue_PyFRawMesh
1116
{

Source/UnrealEnginePython/Private/Wrappers/UEPyFSoftSkinVertex.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ static int py_ue_fsoft_skin_vertex_set_tangent_z(ue_PyFSoftSkinVertex *self, PyO
8989

9090
static PyObject *py_ue_fsoft_skin_vertex_get_influence_bones(ue_PyFSoftSkinVertex *self, void *closure)
9191
{
92-
uint8 *data = self->ss_vertex.InfluenceBones;
92+
#if ENGINE_MINOR_VERSION >= 25
93+
uint16* data = self->ss_vertex.InfluenceBones;
94+
#else
95+
uint8* data = self->ss_vertex.InfluenceBones;
96+
#endif
9397
return Py_BuildValue((char*)"(iiiiiiii)", data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7]);
9498
}
9599

0 commit comments

Comments
 (0)