unreal.TypedElementSelectionSet

class unreal.TypedElementSelectionSet(outer: Object | None = None, name: Name | str = 'None')

Bases: Object

A wrapper around an element list that ensures mutation goes via the selection interfaces, as well as providing some utilities for batching operations.

C++ Source:

  • Module: TypedElementRuntime

  • File: TypedElementSelectionSet.h

Editor Properties: (see get_editor_property/set_editor_property)

  • on_pre_selection_change (OnPreChangeDynamic): [Read-Write] Delegate that is invoked whenever the underlying element list is potentially about to change.

  • on_selection_change (OnChangeDynamic): [Read-Write] Delegate that is invoked whenever the underlying element list has been changed.

allow_selection_modifiers(element_handle) bool

Test to see whether selection modifiers (Ctrl or Shift) are allowed while selecting this element.

Parameters:

element_handle (ScriptTypedElementHandle) –

Return type:

bool

can_deselect_element(element_handle, selection_options) bool

Test to see whether the given element can be deselected.

Parameters:
Return type:

bool

can_select_element(element_handle, selection_options) bool

Test to see whether the given element can be selected.

Parameters:
Return type:

bool

clear_selection(selection_options) bool

Clear the current selection.

Parameters:

selection_options (TypedElementSelectionOptions) –

Returns:

True if the selection was changed, false otherwise.

Return type:

bool

count_selected_elements(base_interface_type=None) int32

Count the number of selected elements, optionally filtering to elements that implement the given interface.

Parameters:

base_interface_type (type(Class)) –

Return type:

int32

count_selected_objects(required_class=None) int32

Count the number of selected objects.

Parameters:

required_class (type(Class)) –

Return type:

int32

deselect_element(element_handle, selection_options) bool

Attempt to deselect the given element.

Parameters:
Returns:

True if the selection was changed, false otherwise.

Return type:

bool

deselect_elements(element_handles, selection_options) bool

Attempt to deselect the given elements.

Parameters:
Returns:

True if the selection was changed, false otherwise.

Return type:

bool

deselect_elements_from_list(element_list, selection_options) bool

Attempt to deselect the given elements.

Parameters:
Returns:

True if the selection was changed, false otherwise.

Return type:

bool

get_bottom_selected_object(required_class=None) Object

Get the last selected object of the given type.

Parameters:

required_class (type(Class)) –

Return type:

Object

get_current_selection_state() TypedElementSelectionSetState

Serializes the current selection set. The calling code is responsible for storing any state information. The selection set can be returned to a prior state using RestoreSelectionState.

Returns:

the current state of the selection set.

Return type:

TypedElementSelectionSetState

get_normalized_element_list(element_list, normalization_options) TypedElementList

Get a normalized version of the given element list that can be used to perform operations like gizmo manipulation, deletion, copying, etc. This will do things like expand out groups, and resolve any parent<->child elements so that duplication operations aren’t performed on both the parent and the child.

Parameters:
Return type:

TypedElementList

get_normalized_selection(normalization_options) TypedElementList

Get a normalized version of this selection set that can be used to perform operations like gizmo manipulation, deletion, copying, etc. This will do things like expand out groups, and resolve any parent<->child elements so that duplication operations aren’t performed on both the parent and the child.

Parameters:

normalization_options (TypedElementSelectionNormalizationOptions) –

Return type:

TypedElementList

get_num_selected_elements() int32

Get the number of selected elements.

Return type:

int32

get_selected_element_handles(base_interface_type=None) Array[ScriptTypedElementHandle]

Get the handle of every selected element, optionally filtering to elements that implement the given interface.

Parameters:

base_interface_type (type(Class)) –

Return type:

Array[ScriptTypedElementHandle]

get_selected_objects(required_class=None) Array[Object]

Get the array of selected objects from the currently selected elements.

Parameters:

required_class (type(Class)) –

Return type:

Array[Object]

get_selection_element(element_handle, selection_method) ScriptTypedElementHandle

Given an element, return the element that should actually perform a selection operation.

Parameters:
Return type:

ScriptTypedElementHandle

get_top_selected_object(required_class=None) Object

Get the first selected object of the given type.

Parameters:

required_class (type(Class)) –

Return type:

Object

has_selected_elements(base_interface_type=None) bool

Test whether there selected elements, optionally filtering to elements that implement the given interface.

Parameters:

base_interface_type (type(Class)) –

Return type:

bool

has_selected_objects(required_class=None) bool

Test whether there are any selected objects.

Parameters:

required_class (type(Class)) –

Return type:

bool

is_element_selected(element_handle, selection_options) bool

Test to see whether the given element is currently considered selected.

Parameters:
Return type:

bool

property on_pre_selection_change: OnPreChangeDynamic

[Read-Write] Delegate that is invoked whenever the underlying element list is potentially about to change.

Type:

(OnPreChangeDynamic)

property on_selection_change: OnChangeDynamic

[Read-Write] Delegate that is invoked whenever the underlying element list has been changed.

Type:

(OnChangeDynamic)

restore_selection_state(selection_state) None

Restores the selection set from the given state. The calling code is responsible for managing any undo state.

Parameters:

selection_state (TypedElementSelectionSetState) –

select_element(element_handle, selection_options) bool

Attempt to select the given element.

Parameters:
Returns:

True if the selection was changed, false otherwise.

Return type:

bool

select_elements(element_handles, selection_options) bool

Attempt to select the given elements.

Parameters:
Returns:

True if the selection was changed, false otherwise.

Return type:

bool

select_elements_from_list(element_list, selection_options) bool

Attempt to select the given elements.

Parameters:
Returns:

True if the selection was changed, false otherwise.

Return type:

bool

set_selection(element_handles, selection_options) bool

Attempt to make the selection the given elements. note: Equivalent to calling ClearSelection then SelectElements, but happens in a single batch.

Parameters:
Returns:

True if the selection was changed, false otherwise.

Return type:

bool

set_selection_from_list(element_list, selection_options) bool

Attempt to make the selection the given elements. note: Equivalent to calling ClearSelection then SelectElements, but happens in a single batch.

Parameters:
Returns:

True if the selection was changed, false otherwise.

Return type:

bool