1212#include " UnrealEd.h"
1313#include " FbxMeshUtils.h"
1414#include " Kismet2/BlueprintEditorUtils.h"
15+
1516#include " Editor/LevelEditor/Public/LevelEditorActions.h"
1617#include " Editor/UnrealEd/Public/EditorLevelUtils.h"
1718#include " Runtime/Projects/Public/Interfaces/IPluginManager.h"
4142
4243#include " UEPyIPlugin.h"
4344
45+
4446PyObject *py_unreal_engine_redraw_all_viewports (PyObject * self, PyObject * args)
4547{
4648 FEditorSupportDelegates::RedrawAllViewports.Broadcast ();
@@ -1140,7 +1142,9 @@ PyObject *py_unreal_engine_get_selected_assets(PyObject * self, PyObject * args)
11401142
11411143PyObject *py_unreal_engine_get_all_edited_assets (PyObject * self, PyObject * args)
11421144{
1143- TArray<UObject *> assets = FAssetEditorManager::Get ().GetAllEditedAssets ();
1145+
1146+ // UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
1147+ TArray<UObject *> assets = GEditor->GetEditorSubsystem <UAssetEditorSubsystem>()->GetAllEditedAssets ();
11441148 PyObject *assets_list = PyList_New (0 );
11451149
11461150 for (UObject *asset : assets)
@@ -1168,7 +1172,9 @@ PyObject *py_unreal_engine_open_editor_for_asset(PyObject * self, PyObject * arg
11681172 if (!u_obj)
11691173 return PyErr_Format (PyExc_Exception, " argument is not a UObject" );
11701174
1171- if (FAssetEditorManager::Get ().OpenEditorForAsset (u_obj))
1175+ // UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
1176+
1177+ if (GEditor->GetEditorSubsystem <UAssetEditorSubsystem>()->OpenEditorForAsset (u_obj))
11721178 {
11731179 Py_RETURN_TRUE;
11741180 }
@@ -1193,7 +1199,8 @@ PyObject *py_unreal_engine_find_editor_for_asset(PyObject * self, PyObject * arg
11931199 if (py_bool && PyObject_IsTrue (py_bool))
11941200 bFocus = true ;
11951201
1196- IAssetEditorInstance *instance = FAssetEditorManager::Get ().FindEditorForAsset (u_obj, bFocus);
1202+ // UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
1203+ IAssetEditorInstance *instance = GEditor->GetEditorSubsystem <UAssetEditorSubsystem>()->FindEditorForAsset (u_obj, bFocus);
11971204 if (!instance)
11981205 return PyErr_Format (PyExc_Exception, " no editor found for asset" );
11991206
@@ -1212,14 +1219,16 @@ PyObject *py_unreal_engine_close_editor_for_asset(PyObject * self, PyObject * ar
12121219 UObject *u_obj = ue_py_check_type<UObject>(py_obj);
12131220 if (!u_obj)
12141221 return PyErr_Format (PyExc_Exception, " argument is not a UObject" );
1215- FAssetEditorManager::Get ().CloseAllEditorsForAsset (u_obj);
1222+
1223+ // UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
1224+ GEditor->GetEditorSubsystem <UAssetEditorSubsystem>()->CloseAllEditorsForAsset (u_obj);
12161225
12171226 Py_RETURN_NONE;
12181227}
12191228
12201229PyObject *py_unreal_engine_close_all_asset_editors (PyObject * self, PyObject * args)
12211230{
1222- FAssetEditorManager::Get (). CloseAllAssetEditors ();
1231+ GEditor-> GetEditorSubsystem <UAssetEditorSubsystem>()-> CloseAllAssetEditors ();
12231232
12241233 Py_RETURN_NONE;
12251234}
@@ -1355,7 +1364,7 @@ PyObject *py_unreal_engine_reload_blueprint(PyObject * self, PyObject * args)
13551364 UBlueprint *reloaded_bp = nullptr ;
13561365
13571366 Py_BEGIN_ALLOW_THREADS
1358- reloaded_bp = FKismetEditorUtilities::ReloadBlueprint ( bp);
1367+ reloaded_bp = FKismetEditorUtilities::ReplaceBlueprint (bp, bp);
13591368 Py_END_ALLOW_THREADS
13601369
13611370 Py_RETURN_UOBJECT (reloaded_bp);
0 commit comments