Download

how to get sublevels in python

I’m curious if there is a way to grab the sub-levels in a world via python. It seems in C++, a UWorld object has PersistentLevel and StreamingLevels variables. I’m not finding these in python. Any other methods?

would also be glad to know

Here, something like that, i think you’ll get an idea. To get the actual level, you nedd to get somehow it’s world context object (each level has it’s own world). In this example i’m geting it from selected landscape streaming proxys



actors = unreal.EditorLevelLibrary.get_selected_level_actors()

land_streaming_proxy_list = ]

for actor in actors:
        if asset_class_name == 'LandscapeStreamingProxy':
                land_streaming_proxy_list.append(actor)

for level in land_streaming_proxy_list:

        level_world = level.get_world()
        level_name = level.get_path_name().split(':')[0].split('.')-1]
        streaming_level = unreal.GameplayStatics.get_streaming_level(level_world, level_name)


Also interested. Did any of you guys get an answer?

If you want to learn sublevels in Python then you have to learn from Experts and join Python Training Classes in Noida