Python: How to get currently loaded Level Sequence? UE 4-27

Hi,

I’m trying to figure out how to get the currently loaded Level Sequence. I’ve been using the following and then filter through the items and figure out which one has a class_name of ‘LevelSequence’:

selected_assets = unreal.EditorUtilityLibrary.get_selected_assets()

This way is a bit limited and requires the user to select the level sequence before running code. I wondered if there is a way to get the path or asset of the loaded level sequence or just loaded assets, which I can filter through to find the level sequence.

Thanks,

Adnan Hussain

You can get it with get_current_level_sequence() in LevelSequenceEditorBlueprintLibrary

https://docs.unrealengine.com/4.27/en-US/PythonAPI/class/LevelSequenceEditorBlueprintLibrary.html

Thanks Max Chen, that was exactly what I needed!