Skip to content

Commit 2542a72

Browse files
author
Roberto De Ioris
committed
fixed 4.13 support
1 parent ce61942 commit 2542a72

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Source/UnrealEnginePython/Private/UEPyEditor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,11 @@ PyObject *py_unreal_engine_duplicate_asset(PyObject * self, PyObject * args) {
446446

447447
TSet<UPackage *> refused_packages;
448448
FText error_text;
449+
#if ENGINE_MINOR_VERSION < 14
450+
UObject *new_asset = ObjectTools::DuplicateSingleObject(u_object, pgn, refused_packages);
451+
#else
449452
UObject *new_asset = ObjectTools::DuplicateSingleObject(u_object, pgn, refused_packages, false);
453+
#endif
450454
if (!new_asset) {
451455
return PyErr_Format(PyExc_Exception, "unable to duplicate asset %s", path);
452456
}

Source/UnrealEnginePython/Private/UEPyIPlugin.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ static PyObject *py_ue_iplugin_to_json(ue_PyIPlugin *self, PyObject * args) {
6060

6161
FPluginDescriptor descriptor = self->plugin->GetDescriptor();
6262
FString text;
63+
#if ENGINE_MINOR_VERSION < 14
64+
text = descriptor.ToString();
65+
#else
6366
descriptor.Write(text, enabled_by_default);
67+
#endif
6468

6569
return PyUnicode_FromString(TCHAR_TO_UTF8(*text));
6670
}
@@ -81,13 +85,17 @@ static PyObject *py_ue_iplugin_from_json(ue_PyIPlugin *self, PyObject * args) {
8185
FText error;
8286
FString text = FString(UTF8_TO_TCHAR(json));
8387
FPluginDescriptor descriptor = self->plugin->GetDescriptor();
88+
#if ENGINE_MINOR_VERSION < 14
89+
if (!descriptor.Read(text, error)) {
90+
#else
8491
if (!descriptor.Read(text, enabled_by_default, error)) {
92+
#endif
8593
return PyErr_Format(PyExc_Exception, "unable to update descriptor from json");
8694
}
8795

8896
Py_INCREF(Py_None);
8997
return Py_None;
90-
}
98+
}
9199

92100
static PyMethodDef ue_PyIPlugin_methods[] = {
93101
{ "get_name", (PyCFunction)py_ue_iplugin_get_name, METH_VARARGS, "" },

0 commit comments

Comments
 (0)