@@ -322,6 +322,7 @@ static PyMethodDef ue_PyUObject_methods[] = {
322322 { " post_edit_change" , (PyCFunction)py_ue_post_edit_change, METH_VARARGS, " " },
323323
324324#if WITH_EDITOR
325+ { " save_config" , (PyCFunction)py_ue_save_config, METH_VARARGS, " " },
325326 { " get_actor_label" , (PyCFunction)py_ue_get_actor_label, METH_VARARGS, " " },
326327 { " set_actor_label" , (PyCFunction)py_ue_set_actor_label, METH_VARARGS, " " },
327328
@@ -1383,7 +1384,7 @@ PyObject *ue_py_convert_property(UProperty *prop, uint8 *buffer) {
13831384 FLinearColor color = *casted_prop->ContainerPtrToValuePtr <FLinearColor>(buffer);
13841385 return py_ue_new_flinearcolor (color);
13851386 }
1386- return (PyObject *) py_ue_new_uscriptstruct (casted_struct, casted_prop->ContainerPtrToValuePtr <uint8>(buffer));
1387+ return py_ue_new_uscriptstruct (casted_struct, casted_prop->ContainerPtrToValuePtr <uint8>(buffer));
13871388 }
13881389 return PyErr_Format (PyExc_TypeError, " unsupported UStruct type" );
13891390 }
@@ -1415,22 +1416,7 @@ PyObject *ue_py_convert_property(UProperty *prop, uint8 *buffer) {
14151416 FScriptArrayHelper_InContainer array_helper (casted_prop, buffer);
14161417 PyObject *py_list = PyList_New (0 );
14171418 UProperty *array_prop = casted_prop->Inner ;
1418- /* if (array_prop->IsA<UStructProperty>()) {
1419- uint8 *array_buffer = (uint8 *)FMemory::Malloc(array_prop->GetSize());
1420- array_prop->InitializeValue(array_buffer);
1421- for (int i = 0; i < array_helper.Num(); i++) {
1422- array_prop->CopyCompleteValueFromScriptVM(array_buffer, array_helper.GetRawPtr(i));
1423- PyObject *item = ue_py_convert_property(array_prop, array_buffer);
1424- //array_prop->DestroyValue(array_buffer);
1425- if (!item) {
1426- Py_DECREF(py_list);
1427- return NULL;
1428- }
1429- PyList_Append(py_list, item);
1430- Py_DECREF(item);
1431- }
1432- }
1433- else {*/
1419+
14341420 for (int i = 0 ; i < array_helper.Num (); i++) {
14351421 PyObject *item = ue_py_convert_property (array_prop, array_helper.GetRawPtr (i));
14361422 if (!item) {
@@ -1440,7 +1426,7 @@ PyObject *ue_py_convert_property(UProperty *prop, uint8 *buffer) {
14401426 PyList_Append (py_list, item);
14411427 Py_DECREF (item);
14421428 }
1443- // }
1429+
14441430 return py_list;
14451431 }
14461432
@@ -1522,29 +1508,12 @@ bool ue_py_convert_pyobject(PyObject *py_obj, UProperty *prop, uint8 *buffer) {
15221508 helper.RemoveValues (pylist_len, helper.Num () - pylist_len);
15231509 }
15241510
1525- /* if (array_prop->IsA<UStructProperty>()) {
1526- for (int i = 0; i < (int)pylist_len; i++) {
1527- PyObject *py_item = PyList_GetItem(py_obj, i);
1528- // ensure py_item is a UScriptStruct
1529- if (ue_PyUScriptStruct *u_struct = py_ue_is_uscriptstruct(py_item)) {
1530- array_prop->CopySingleValue(helper.GetRawPtr(i), u_struct->data);
1531- }
1532- Py_DECREF(py_item);
1533- }
1534- return true;
1535- }
1536- else {*/
1537-
15381511 for (int i = 0 ; i < (int )pylist_len; i++) {
1539- uint8 *item_buf = helper.GetRawPtr (i);
15401512 PyObject *py_item = PyList_GetItem (py_obj, i);
1541- if (!ue_py_convert_pyobject (py_item, array_prop, item_buf)) {
1542- Py_DECREF (py_item);
1513+ if (!ue_py_convert_pyobject (py_item, array_prop, helper.GetRawPtr (i))) {
15431514 return false ;
15441515 }
1545- Py_DECREF (py_item);
15461516 }
1547- // }
15481517 return true ;
15491518 }
15501519
0 commit comments