Download

Get levels from world in python

Currently, when I get all the level actors using the following api call: unreal.EditorLevelLibrary.get_all_level_actors()

It will return actors that are in hidden sub levels too. I would like to only get actors in visible levels.

So I would like to be able to get the levels listed in the level editor in python

image

Then I can query if the level is visible or not. Can this easily be done?

Just bumping this post.

unreal.Actor — Unreal Python 4.26 (Experimental) documentation (unrealengine.com)

Actor Type has a method is_hidden_ed can check the actor is hidden or not.

Yes, this is what I ended up using.

However, I found this a bit buggy. It was returning hidden lights as False. I needed to “refresh” the editor by, toggling the visibility on/off to get the right value returned.