MCPcopy Create free account
hub / github.com/20tab/UnrealEnginePython / py_ue_as_dict

Function py_ue_as_dict

Source/UnrealEnginePython/Private/UEPyObject.cpp:717–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

715}
716
717PyObject *py_ue_as_dict(ue_PyUObject * self, PyObject * args) {
718
719 ue_py_check(self);
720
721 UStruct *u_struct = nullptr;
722
723 if (self->ue_object->IsA<UStruct>()) {
724 u_struct = (UStruct *)self->ue_object;
725 }
726 else {
727 u_struct = (UStruct *)self->ue_object->GetClass();
728 }
729
730 PyObject *py_struct_dict = PyDict_New();
731 TFieldIterator<UProperty> SArgs(u_struct);
732 for (; SArgs; ++SArgs) {
733 PyObject *struct_value = ue_py_convert_property(*SArgs, (uint8 *)self->ue_object);
734 if (!struct_value) {
735 Py_DECREF(py_struct_dict);
736 return NULL;
737 }
738 PyDict_SetItemString(py_struct_dict, TCHAR_TO_UTF8(*SArgs->GetName()), struct_value);
739 }
740 return py_struct_dict;
741}
742
743PyObject *py_ue_get_cdo(ue_PyUObject * self, PyObject * args) {
744

Callers

nothing calls this directly

Calls 1

ue_py_convert_propertyFunction · 0.85

Tested by

no test coverage detected