I'm using this bit of hacky code to get the selected assets in the content browser:
First of all, there needs to be a simpler way to do something as common as getting selected assets in the content browser.
Second of all, working this way seems to cause instability when trying to delete assets in the same python script. When my scripts use unreal.EditorAssetLibrary.delete_asset(), they crash. If I remove the GlobalEditorUtilityBase bit, they don't crash. If I use GlobalEditorUtilityBase and don't delete assets, they don't crash. The crash logs point to the MyEditorUtility hot-reloading at the time of crash. Has anyone else experienced this?
Code:
@ue.uclass() class MyEditorUtility(ue.GlobalEditorUtilityBase): pass editor_util = MyEditorUtility() editor_util.get_selected_assets()
Second of all, working this way seems to cause instability when trying to delete assets in the same python script. When my scripts use unreal.EditorAssetLibrary.delete_asset(), they crash. If I remove the GlobalEditorUtilityBase bit, they don't crash. If I use GlobalEditorUtilityBase and don't delete assets, they don't crash. The crash logs point to the MyEditorUtility hot-reloading at the time of crash. Has anyone else experienced this?
Comment