@@ -304,6 +304,9 @@ static PyMethodDef unreal_engine_methods[] = {
304304
305305 { " add_asset_view_context_menu_extension" , py_unreal_engine_add_asset_view_context_menu_extension, METH_VARARGS, " " },
306306
307+ { " redraw_all_viewports" , py_unreal_engine_redraw_all_viewports, METH_VARARGS, " " },
308+ { " update_ui" , py_unreal_engine_update_ui, METH_VARARGS, " " },
309+
307310#pragma warning(suppress: 4191)
308311 { " create_detail_view" , (PyCFunction)py_unreal_engine_create_detail_view, METH_VARARGS | METH_KEYWORDS, " " },
309312#pragma warning(suppress: 4191)
@@ -463,7 +466,7 @@ static PyMethodDef unreal_engine_methods[] = {
463466 { " get_viewport_size" , py_unreal_engine_get_viewport_size, METH_VARARGS, " " },
464467 { " get_resolution" , py_unreal_engine_get_resolution, METH_VARARGS, " " },
465468 { " get_game_viewport_size" , py_unreal_engine_get_game_viewport_size, METH_VARARGS, " " },
466-
469+
467470 { " get_game_viewport_client" , py_unreal_engine_get_game_viewport_client, METH_VARARGS, " " },
468471#pragma warning(suppress: 4191)
469472 { " open_color_picker" , (PyCFunction)py_unreal_engine_open_color_picker, METH_VARARGS | METH_KEYWORDS, " " },
@@ -1138,6 +1141,8 @@ static PyMethodDef ue_PyUObject_methods[] = {
11381141 { " as_dict" , (PyCFunction)py_ue_as_dict, METH_VARARGS, " " },
11391142
11401143 { " get_cdo" , (PyCFunction)py_ue_get_cdo, METH_VARARGS, " " },
1144+ { " get_archetype" , (PyCFunction)py_ue_get_archetype, METH_VARARGS, " " },
1145+ { " get_archetype_instances" , (PyCFunction)py_ue_get_archetype_instances, METH_VARARGS, " " },
11411146 { " enum_values" , (PyCFunction)py_ue_enum_values, METH_VARARGS, " " },
11421147 { " enum_names" , (PyCFunction)py_ue_enum_names, METH_VARARGS, " " },
11431148#if ENGINE_MINOR_VERSION >= 15
@@ -1295,8 +1300,35 @@ static int ue_PyUObject_setattro(ue_PyUObject *self, PyObject *attr_name, PyObje
12951300 UProperty *u_property = u_struct->FindPropertyByName (FName (UTF8_TO_TCHAR (attr)));
12961301 if (u_property)
12971302 {
1303+ #if WITH_EDITOR
1304+ self->ue_object ->PreEditChange (u_property);
1305+ #endif
12981306 if (ue_py_convert_pyobject (value, u_property, (uint8*)self->ue_object , 0 ))
12991307 {
1308+ #if WITH_EDITOR
1309+ FPropertyChangedEvent PropertyEvent (u_property, EPropertyChangeType::ValueSet);
1310+ self->ue_object ->PostEditChangeProperty (PropertyEvent);
1311+
1312+ if (self->ue_object ->HasAnyFlags (RF_ArchetypeObject | RF_ClassDefaultObject))
1313+ {
1314+ TArray<UObject *> Instances;
1315+ self->ue_object ->GetArchetypeInstances (Instances);
1316+ for (UObject *Instance : Instances)
1317+ {
1318+ Instance->PreEditChange (u_property);
1319+ if (ue_py_convert_pyobject (value, u_property, (uint8*)Instance, 0 ))
1320+ {
1321+ FPropertyChangedEvent PropertyEvent (u_property, EPropertyChangeType::ValueSet);
1322+ Instance->PostEditChangeProperty (PropertyEvent);
1323+ }
1324+ else
1325+ {
1326+ PyErr_SetString (PyExc_ValueError, " invalid value for UProperty" );
1327+ return -1 ;
1328+ }
1329+ }
1330+ }
1331+ #endif
13001332 return 0 ;
13011333 }
13021334 PyErr_SetString (PyExc_ValueError, " invalid value for UProperty" );
@@ -1726,7 +1758,9 @@ void unreal_engine_init_py_module()
17261758 PyDict_SetItemString (unreal_engine_dict, " RF_MARKASNATIVE" , PyLong_FromUnsignedLongLong ((uint64)RF_MarkAsNative));
17271759 PyDict_SetItemString (unreal_engine_dict, " RF_TRANSACTIONAL" , PyLong_FromUnsignedLongLong ((uint64)RF_Transactional));
17281760 PyDict_SetItemString (unreal_engine_dict, " RF_CLASSDEFAULTOBJECT" , PyLong_FromUnsignedLongLong ((uint64)RF_ClassDefaultObject));
1761+ PyDict_SetItemString (unreal_engine_dict, " RF_CLASS_DEFAULT_OBJECT" , PyLong_FromUnsignedLongLong ((uint64)RF_ClassDefaultObject));
17291762 PyDict_SetItemString (unreal_engine_dict, " RF_ARCHETYPEOBJECT" , PyLong_FromUnsignedLongLong ((uint64)RF_ArchetypeObject));
1763+ PyDict_SetItemString (unreal_engine_dict, " RF_ARCHETYPE_OBJECT" , PyLong_FromUnsignedLongLong ((uint64)RF_ArchetypeObject));
17301764 PyDict_SetItemString (unreal_engine_dict, " RF_TRANSIENT" , PyLong_FromUnsignedLongLong ((uint64)RF_Transient));
17311765 PyDict_SetItemString (unreal_engine_dict, " RF_MARKASROOTSET" , PyLong_FromUnsignedLongLong ((uint64)RF_MarkAsRootSet));
17321766 PyDict_SetItemString (unreal_engine_dict, " RF_TAGGARBAGETEMP" , PyLong_FromUnsignedLongLong ((uint64)RF_TagGarbageTemp));
@@ -1814,10 +1848,10 @@ ue_PyUObject *ue_get_python_uobject(UObject *ue_obj)
18141848 UE_LOG (LogPython, Warning, TEXT (" CREATED UPyObject at %p for %p %s" ), ue_py_object, ue_obj, *ue_obj->GetName ());
18151849#endif
18161850 return ue_py_object;
1817- }
1851+ }
18181852 return ret;
18191853
1820- }
1854+ }
18211855
18221856ue_PyUObject *ue_get_python_uobject_inc (UObject *ue_obj)
18231857{
@@ -1905,7 +1939,7 @@ void unreal_engine_py_log_error()
19051939 }
19061940
19071941 PyErr_Clear ();
1908- }
1942+ }
19091943
19101944// retrieve a UWorld from a generic UObject (if possible)
19111945UWorld *ue_get_uworld (ue_PyUObject *py_obj)
@@ -2841,8 +2875,8 @@ PyObject *py_ue_ufunction_call(UFunction *u_function, UObject *u_obj, PyObject *
28412875#endif
28422876 }
28432877#endif
2878+ }
28442879 }
2845- }
28462880
28472881
28482882 Py_ssize_t tuple_len = PyTuple_Size (args);
@@ -2955,7 +2989,7 @@ PyObject *py_ue_ufunction_call(UFunction *u_function, UObject *u_obj, PyObject *
29552989 return ret;
29562990
29572991 Py_RETURN_NONE;
2958- }
2992+ }
29592993
29602994PyObject *ue_bind_pyevent (ue_PyUObject *u_obj, FString event_name, PyObject *py_callable, bool fail_on_wrong_property)
29612995{
@@ -3015,8 +3049,8 @@ UFunction *unreal_engine_add_function(UClass *u_class, char *name, PyObject *py_
30153049 {
30163050 UE_LOG (LogPython, Error, TEXT (" function %s is already registered" ), UTF8_TO_TCHAR (name));
30173051 return nullptr ;
3018- }
30193052 }
3053+ }
30203054
30213055 UPythonFunction *function = NewObject<UPythonFunction>(u_class, UTF8_TO_TCHAR (name), RF_Public | RF_Transient | RF_MarkAsNative);
30223056 function->SetPyCallable (py_callable);
@@ -3337,7 +3371,7 @@ UFunction *unreal_engine_add_function(UClass *u_class, char *name, PyObject *py_
33373371#endif
33383372
33393373 return function;
3340- }
3374+ }
33413375
33423376FGuid *ue_py_check_fguid (PyObject *py_obj)
33433377{
0 commit comments