@@ -286,7 +286,7 @@ PyObject *py_unreal_engine_editor_play(PyObject * self, PyObject * args)
286286 Py_END_ALLOW_THREADS;
287287
288288 Py_RETURN_NONE;
289- }
289+ }
290290
291291PyObject *py_unreal_engine_editor_select_actor (PyObject * self, PyObject * args)
292292{
@@ -462,7 +462,7 @@ PyObject *py_unreal_engine_import_asset(PyObject * self, PyObject * args)
462462 }
463463
464464 Py_RETURN_NONE;
465- }
465+ }
466466
467467PyObject *py_unreal_engine_editor_tick (PyObject * self, PyObject * args)
468468{
@@ -796,7 +796,7 @@ PyObject *py_unreal_engine_rename_asset(PyObject * self, PyObject * args)
796796#endif
797797
798798 Py_RETURN_NONE;
799- }
799+ }
800800
801801PyObject *py_unreal_engine_duplicate_asset (PyObject * self, PyObject * args)
802802{
@@ -1879,7 +1879,11 @@ PyObject *py_unreal_engine_editor_on_asset_post_import(PyObject * self, PyObject
18791879 return PyErr_Format (PyExc_Exception, " object is not a callable" );
18801880
18811881 TSharedRef<FPythonSmartDelegate> py_delegate = FUnrealEnginePythonHouseKeeper::Get ()->NewPythonSmartDelegate (py_callable);
1882+ #if ENGINE_MINOR_VERSION > 21
1883+ GEditor->GetEditorSubsystem <UImportSubsystem>()->OnAssetPostImport .AddSP (py_delegate, &FPythonSmartDelegate::PyFOnAssetPostImport);
1884+ #else
18821885 FEditorDelegates::OnAssetPostImport.AddSP (py_delegate, &FPythonSmartDelegate::PyFOnAssetPostImport);
1886+ #endif
18831887 Py_RETURN_NONE;
18841888}
18851889
@@ -2115,7 +2119,7 @@ PyObject *py_unreal_engine_add_level_to_world(PyObject *self, PyObject * args)
21152119#endif
21162120
21172121 Py_RETURN_UOBJECT (level_streaming);
2118- }
2122+ }
21192123
21202124PyObject *py_unreal_engine_move_selected_actors_to_level (PyObject *self, PyObject * args)
21212125{
@@ -2533,7 +2537,11 @@ PyObject *py_unreal_engine_unregister_settings(PyObject * self, PyObject * args)
25332537
25342538PyObject *py_unreal_engine_all_viewport_clients (PyObject * self, PyObject * args)
25352539{
2540+ #if ENGINE_MINOR_VERSION > 21
2541+ TArray<FEditorViewportClient *> clients = GEditor->GetAllViewportClients ();
2542+ #else
25362543 TArray<FEditorViewportClient *> clients = GEditor->AllViewportClients ;
2544+ #endif
25372545 PyObject *py_list = PyList_New (0 );
25382546 for (FEditorViewportClient *client : clients)
25392547 {
@@ -2647,5 +2655,6 @@ PyObject *py_unreal_engine_export_assets(PyObject * self, PyObject * args)
26472655
26482656 Py_RETURN_NONE;
26492657}
2658+
26502659#endif
26512660
0 commit comments