File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Source/UnrealEnginePython/Private Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -764,9 +764,14 @@ PyObject *py_ue_as_dict(ue_PyUObject * self, PyObject * args) {
764764 ue_py_check (self);
765765
766766 UStruct *u_struct = nullptr ;
767+ UObject *u_object = self->ue_object ;
767768
768769 if (self->ue_object ->IsA <UStruct>()) {
769770 u_struct = (UStruct *)self->ue_object ;
771+ if (self->ue_object ->IsA <UClass>()) {
772+ UClass *u_class = (UClass *)self->ue_object ;
773+ u_object = u_class->GetDefaultObject ();
774+ }
770775 }
771776 else {
772777 u_struct = (UStruct *)self->ue_object ->GetClass ();
@@ -775,7 +780,7 @@ PyObject *py_ue_as_dict(ue_PyUObject * self, PyObject * args) {
775780 PyObject *py_struct_dict = PyDict_New ();
776781 TFieldIterator<UProperty> SArgs (u_struct);
777782 for (; SArgs; ++SArgs) {
778- PyObject *struct_value = ue_py_convert_property (*SArgs, (uint8 *)self-> ue_object );
783+ PyObject *struct_value = ue_py_convert_property (*SArgs, (uint8 *)u_object );
779784 if (!struct_value) {
780785 Py_DECREF (py_struct_dict);
781786 return NULL ;
You can’t perform that action at this time.
0 commit comments