Python: Get streaming/sub level visibility

Hey, Im currently trying to grab the visibility of all of current sub levels

I have the following code to grab the list of all sublevels Which I would then like to iterate over to grab the level visibility, but cannot figure it out? if it’s even possible with the python API?

any help would be greatly appreciated.

`import unreal

world = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world()
subLevelList = unreal.EditorLevelUtils.get_levels(world)

print (subLevelList)`

1 Like

double post but cannot remove it, pasting the solution here as well

world = unreal.get_editor_subsystem(unreal.UnrealEditorSubsystem).get_editor_world()
subLevelList = unreal.EditorLevelUtils.get_levels(world)
 
for subLevel in subLevelList:
    subLevelPackageName = subLevel.get_package().get_name()
    streamingLevel = unreal.GameplayStatics.get_streaming_level(world, subLevelPackageName)
    if streamingLevel:
        print (subLevel.get_path_name())
        print (streamingLevel.is_level_visible())