unreal.LevelEditorSubsystem¶
- class unreal.LevelEditorSubsystem(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
EditorSubsystemULevelEditorSubsystem Subsystem for exposing Level Editor related functionality to scripts
C++ Source:
Module: LevelEditor
File: LevelEditorSubsystem.h
Editor Properties: (see get_editor_property/set_editor_property)
on_editor_camera_moved(OnLevelEditorEditorCameraMoved): [Read-Write] Expose EditorCameraMoved to blueprintson_map_changed(OnLevelEditorMapChanged): [Read-Write] Expose MapChanged to blueprints. Note: This executes too early for some editor scripting, consider using OnMapOpened if this doesn’t work for you.on_map_opened(OnLevelEditorMapOpened): [Read-Write] Expose MapOpened to blueprintson_post_save_world(OnLevelEditorPostSaveWorld): [Read-Write] Expose PostSaveWorld to blueprintson_pre_save_world(OnLevelEditorPreSaveWorld): [Read-Write] Expose PreSaveWorld to blueprints
- build_light_maps(quality=LightingBuildQuality.QUALITY_PRODUCTION, with_reflection_captures=False) bool¶
Build Light Maps and optionally the reflection captures.
- Parameters:
quality (LightingBuildQuality) – One of the enum LightingBuildQuality value. Default is Quality_Production.
with_reflection_captures (bool) – Build the related reflection captures after building the light maps.
- Returns:
True if build was successful.
- Return type:
- delete_actor_folder(folder_path) bool¶
Deletes a folder from the World Outliner. Does not move or delete actors; only removes the folder entry itself.
- editor_set_viewport_realtime(realtime, viewport_config_key='None') None¶
Editor Set Viewport Realtime
- eject_pilot_level_actor(viewport_config_key='None') None¶
Eject Pilot Level Actor
- Parameters:
viewport_config_key (Name)
- get_current_level() Level¶
Get the current level used by the world editor.
- Returns:
The current level
- Return type:
- get_level_viewport_camera_info(viewport_config_key) (camera_location=Vector, camera_rotation=Rotator) or None¶
Gets information about the camera position for the given level editor viewport.
- Parameters:
viewport_config_key (Name) – the viewport you wish to get from
- Returns:
Whether we were able to get the camera position for a level editing viewport
camera_location (Vector): (out) Current location of the level editing viewport camera, or zero if none found
camera_rotation (Rotator): (out) Current rotation of the level editing viewport camera, or zero if none found
- Return type:
tuple or None
- get_level_viewport_fov(viewport_config_key) float or None¶
Gets the horizontal field of view for the given level editor viewport.
- get_selection_set() TypedElementSelectionSet¶
Get the selection set for the current world, you can use this to track and create changes to the level editor’s selection
- Return type:
- load_level(asset_path) bool¶
Close the current Persistent Level (without saving it). Loads the specified level.
- new_level(asset_path, is_partitioned_world=False) bool¶
Close the current Persistent Level (without saving it). Create a new blank Level and save it. Load the new created level.
- new_level_from_template(asset_path, template_asset_path) bool¶
Close the current Persistent Level (without saving it). Create a new Level base on another level and save it. Load the new created level.
- property on_editor_camera_moved: OnLevelEditorEditorCameraMoved¶
[Read-Write] Expose EditorCameraMoved to blueprints
- Type:
- property on_map_changed: OnLevelEditorMapChanged¶
This executes too early for some editor scripting, consider using OnMapOpened if this doesn’t work for you.
- Type:
- Type:
[Read-Write] Expose MapChanged to blueprints. Note
- property on_map_opened: OnLevelEditorMapOpened¶
[Read-Write] Expose MapOpened to blueprints
- Type:
- property on_post_save_world: OnLevelEditorPostSaveWorld¶
[Read-Write] Expose PostSaveWorld to blueprints
- Type:
- property on_pre_save_world: OnLevelEditorPreSaveWorld¶
[Read-Write] Expose PreSaveWorld to blueprints
- Type:
- save_all_dirty_levels() bool¶
Saves all Level currently loaded by the World Editor.
- Returns:
True if the operation succeeds.
- Return type:
- save_current_level() bool¶
Saves the specified Level. Must already be saved at lease once to have a valid path.
- Returns:
True if the operation succeeds.
- Return type:
- set_current_level_by_name(level_name) bool¶
Set the current level used by the world editor. If more than one level shares the same name, the first one encounter of that level name will be used.