Sequencer add visibility track and populate parameters

Is it possible at the moment to add a **Level Visibility Track **and change its parameters through python?

Yes, it’s just:

level_visibility_track = level_sequence.add_master_track(unreal.MovieSceneLevelVisibilityTrack)

from there you can adjust the display name and other options (https://docs.unrealengine.com/en-US/…lityTrack.html).

Here’s an example:



def create_level_sequence_level_vis(asset_name, length_seconds = 5, package_path = '/Game/'): sequence = unreal.AssetToolsHelpers.get_asset_tools().create_asset(asset_name, package_path, unreal.LevelSequence, unreal.LevelSequenceFactoryNew())

visible_sub_levels = "visible"]
hidden_sub_levels = "hidden"]

level_vis_track = sequence.add_master_track(unreal.MovieSceneLevelVisibilityTrack)
level_vis_visible_section = level_vis_track.add_section()
level_vis_hidden_section = level_vis_track.add_section()
level_vis_visible_section.set_start_frame_seconds(0)
level_vis_visible_section.set_end_frame_seconds(length_seconds)
level_vis_visible_section.set_visibility(unreal.LevelVisibility.VISIBLE)
level_vis_visible_section.set_row_index(0)

level_vis_visible_section.set_level_names(visible_sub_levels)
level_vis_hidden_section.set_start_frame_seconds(0)
level_vis_hidden_section.set_end_frame_seconds(length_seconds)
level_vis_hidden_section.set_visibility(unreal.LevelVisibility.HIDDEN)
level_vis_hidden_section.set_row_index(1)
level_vis_hidden_section.set_level_names(hidden_sub_levels)