@@ -735,6 +735,39 @@ PyObject *ue_py_convert_property(UProperty *prop, uint8 *buffer) {
735735 goto end;
736736 }
737737
738+ if (auto casted_prop = Cast<UArrayProperty>(prop)) {
739+ FScriptArrayHelper_InContainer array_helper (casted_prop, buffer);
740+ PyObject *py_list = PyList_New (0 );
741+ UProperty *array_prop = casted_prop->Inner ;
742+ if (array_prop->IsA <UStructProperty>()) {
743+ uint8 *array_buffer = (uint8 *)FMemory_Alloca (array_prop->GetSize ());
744+ for (int i = 0 ; i < array_helper.Num (); i++) {
745+ array_prop->InitializeValue (array_buffer);
746+ array_prop->CopyCompleteValueFromScriptVM (array_buffer, array_helper.GetRawPtr (i));
747+ PyObject *item = ue_py_convert_property (array_prop, array_buffer);
748+ array_prop->DestroyValue (array_buffer);
749+ if (!item) {
750+ Py_DECREF (py_list);
751+ return NULL ;
752+ }
753+ PyList_Append (py_list, item);
754+ Py_DECREF (item);
755+ }
756+ }
757+ else {
758+ for (int i = 0 ; i < array_helper.Num (); i++) {
759+ PyObject *item = ue_py_convert_property (array_prop, array_helper.GetRawPtr (i));
760+ if (!item) {
761+ Py_DECREF (py_list);
762+ return NULL ;
763+ }
764+ PyList_Append (py_list, item);
765+ Py_DECREF (item);
766+ }
767+ }
768+ return py_list;
769+ }
770+
738771 return PyErr_Format (PyExc_Exception, " unsupported value type %s for property %s" , TCHAR_TO_UTF8 (*prop->GetClass ()->GetName ()), TCHAR_TO_UTF8 (*prop->GetName ()));
739772
740773end:
@@ -758,20 +791,20 @@ bool ue_py_convert_pyobject(PyObject *py_obj, UProperty *prop, uint8 *buffer) {
758791 return true ;
759792 }
760793
761- if (PyLong_Check (py_obj)) {
762- auto casted_prop = Cast<UIntProperty>(prop);
763- if (!casted_prop)
764- return false ;
765- casted_prop-> SetPropertyValue_InContainer (buffer, PyLong_AsLong (py_obj) );
766- return true ;
767- }
768-
769- if ( PyFloat_Check ( py_obj)) {
770- auto casted_prop = Cast<UFloatProperty>(prop );
771- if (!casted_prop)
772- return false ;
773- casted_prop-> SetPropertyValue_InContainer (buffer, PyFloat_AsDouble (py_obj));
774- return true ;
794+ if (PyNumber_Check (py_obj)) {
795+ if ( auto casted_prop = Cast<UIntProperty>(prop)) {
796+ PyObject *py_long = PyNumber_Long (py_obj);
797+ casted_prop-> SetPropertyValue_InContainer (buffer, PyLong_AsLong (py_long)) ;
798+ Py_DECREF (py_long );
799+ return true ;
800+ }
801+ if ( auto casted_prop = Cast<UFloatProperty>(prop)) {
802+ PyObject *py_float = PyNumber_Float ( py_obj);
803+ casted_prop-> SetPropertyValue_InContainer (buffer, PyFloat_AsDouble (py_float) );
804+ Py_DECREF (py_float);
805+ return true ;
806+ }
807+ return false ;
775808 }
776809
777810 if (PyUnicode_Check (py_obj)) {
@@ -902,6 +935,7 @@ void ue_autobind_events_for_pyclass(ue_PyUObject *u_obj, PyObject *py_class) {
902935}
903936
904937PyObject *py_ue_ufunction_call (UFunction *u_function, UObject *u_obj, PyObject *args, int argn) {
938+
905939 uint8 *buffer = (uint8 *)FMemory_Alloca (u_function->ParmsSize );
906940
907941 Py_ssize_t tuple_len = PyTuple_Size (args);
0 commit comments