unreal.EditorLevelUtils¶
- class unreal.EditorLevelUtils(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
ObjectEditor Level Utils
C++ Source:
Module: UnrealEd
File: EditorLevelUtils.h
- classmethod add_level_to_world(world, level_package_name, level_streaming_class) LevelStreaming¶
Adds the named level package to the world. Does nothing if the level already exists in the world.
Levels are not saved when added to the world. They can be saved with the “Save Map” function
- Parameters:
- Returns:
The new level, or NULL if the level couldn’t added.
- Return type:
- classmethod add_level_to_world_with_transform(world, level_package_name, level_streaming_class, level_transform) LevelStreaming¶
Adds the named level package to the world at the given position. Does nothing if the level already exists in the world.
- Parameters:
- Returns:
The new level, or NULL if the level couldn’t added.
- Return type:
- classmethod create_new_streaming_level(level_streaming_class, new_level_path='', move_selected_actors_into_new_level=False) LevelStreaming¶
Creates a new streaming level in the current world
- Parameters:
level_streaming_class (type(Class)) – The streaming class type instead to use for the level.
new_level_path (str) – Optional path to the level package path format (“e.g /Game/MyLevel”). If empty, the user will be prompted during the save process.
move_selected_actors_into_new_level (bool) – If true, move any selected actors into the new level.
- Returns:
Returns the newly created level, or NULL on failure
- Return type:
- classmethod make_level_current(streaming_level) None¶
Makes the specified streaming level the current level for editing. The current level is where actors are spawned to when calling SpawnActor
- Parameters:
streaming_level (LevelStreaming)
- classmethod move_actors_to_level(actors_to_move, dest_streaming_level, warn_about_references=True, warn_about_renaming=True) int32¶
Moves the specified list of actors to the specified streaming level. The new actors will be selected
- Parameters:
dest_streaming_level (LevelStreaming) – The destination streaming level of the current world to move the actors to
warn_about_references (bool) – Whether or not to show a modal warning about referenced actors that may no longer function after being moved
warn_about_renaming (bool)
- Returns:
The number of actors that were successfully moved to the new level
- Return type:
int32
- classmethod move_selected_actors_to_level(dest_level, warn_about_references=True) int32¶
Moves the currently selected actors to the specified streaming level. The new actors will be selected
- Parameters:
dest_level (LevelStreaming)
warn_about_references (bool) – Whether or not to show a modal warning about referenced actors that may no longer function after being moved
- Returns:
The number of actors that were successfully moved to the new level
- Return type:
int32
- classmethod remove_level_from_world(level, clear_selection=True, reset_transaction_buffer=True) bool¶
Removes given level from the world. Note, this will only work for sub-levels in the main level.
Levels are not saved when added to the world. They can be saved with the “Save Map” function
- Parameters:
- Returns:
True if the level was successfully removed.
- Return type:
- classmethod set_level_visibility(level, should_be_visible, force_layers_visible, modify_mode=LevelVisibilityDirtyMode.MODIFY_ON_CHANGE) None¶
Sets a level’s visibility in the editor. Less efficient than SetLevelsVisibility when changing the visibility of multiple levels simultaneously.
- Parameters:
level (Level) – The level to modify.
should_be_visible (bool) – The level’s new visibility state.
force_layers_visible (bool) – If true and the level is visible, force the level’s layers to be visible.
modify_mode (LevelVisibilityDirtyMode) – ELevelVisibilityDirtyMode mode value.
- classmethod set_levels_visibility(levels, should_be_visible, force_layers_visible, modify_mode=LevelVisibilityDirtyMode.MODIFY_ON_CHANGE) None¶
Sets a level’s visibility in the editor. More efficient than SetLevelsVisibility when changing the visibility of multiple levels simultaneously.
- Parameters:
should_be_visible (Array[bool]) – The level’s new visibility state for each level.
force_layers_visible (bool) – If true and the level is visible, force the level’s layers to be visible.
modify_mode (LevelVisibilityDirtyMode) – ELevelVisibilityDirtyMode mode value.