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:
- can_deselect_element(element_handle, selection_options) bool ¶
Test to see whether the given element can be deselected.
- Parameters:
element_handle (ScriptTypedElementHandle) –
selection_options (TypedElementSelectionOptions) –
- Return type:
- can_select_element(element_handle, selection_options) bool ¶
Test to see whether the given element can be selected.
- Parameters:
element_handle (ScriptTypedElementHandle) –
selection_options (TypedElementSelectionOptions) –
- Return type:
- clear_selection(selection_options) bool ¶
Clear the current selection.
- Parameters:
selection_options (TypedElementSelectionOptions) –
- Returns:
True if the selection was changed, false otherwise.
- Return type:
- count_selected_elements(base_interface_type=None) int32 ¶
Count the number of selected elements, optionally filtering to elements that implement the given interface.
- count_selected_objects(required_class=None) int32 ¶
Count the number of selected objects.
- deselect_element(element_handle, selection_options) bool ¶
Attempt to deselect the given element.
- Parameters:
element_handle (ScriptTypedElementHandle) –
selection_options (TypedElementSelectionOptions) –
- Returns:
True if the selection was changed, false otherwise.
- Return type:
- deselect_elements(element_handles, selection_options) bool ¶
Attempt to deselect the given elements.
- Parameters:
element_handles (Array[ScriptTypedElementHandle]) –
selection_options (TypedElementSelectionOptions) –
- Returns:
True if the selection was changed, false otherwise.
- Return type:
- deselect_elements_from_list(element_list, selection_options) bool ¶
Attempt to deselect the given elements.
- Parameters:
element_list (TypedElementList) –
selection_options (TypedElementSelectionOptions) –
- Returns:
True if the selection was changed, false otherwise.
- Return type:
- get_bottom_selected_object(required_class=None) Object ¶
Get the last selected object of the given type.
- 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:
- 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:
element_list (TypedElementList) –
normalization_options (TypedElementSelectionNormalizationOptions) –
- Return type:
- 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:
- 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:
- Return type:
- get_selected_objects(required_class=None) Array[Object] ¶
Get the array of selected objects from the currently selected elements.
- get_selection_element(element_handle, selection_method) ScriptTypedElementHandle ¶
Given an element, return the element that should actually perform a selection operation.
- Parameters:
element_handle (ScriptTypedElementHandle) –
selection_method (TypedElementSelectionMethod) –
- Return type:
- get_top_selected_object(required_class=None) Object ¶
Get the first selected object of the given type.
- has_selected_elements(base_interface_type=None) bool ¶
Test whether there selected elements, optionally filtering to elements that implement the given interface.
- is_element_selected(element_handle, selection_options) bool ¶
Test to see whether the given element is currently considered selected.
- Parameters:
element_handle (ScriptTypedElementHandle) –
selection_options (TypedElementIsSelectedOptions) –
- Return type:
- 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:
element_handle (ScriptTypedElementHandle) –
selection_options (TypedElementSelectionOptions) –
- Returns:
True if the selection was changed, false otherwise.
- Return type:
- select_elements(element_handles, selection_options) bool ¶
Attempt to select the given elements.
- Parameters:
element_handles (Array[ScriptTypedElementHandle]) –
selection_options (TypedElementSelectionOptions) –
- Returns:
True if the selection was changed, false otherwise.
- Return type:
- select_elements_from_list(element_list, selection_options) bool ¶
Attempt to select the given elements.
- Parameters:
element_list (TypedElementList) –
selection_options (TypedElementSelectionOptions) –
- Returns:
True if the selection was changed, false otherwise.
- Return type:
- 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:
element_handles (Array[ScriptTypedElementHandle]) –
selection_options (TypedElementSelectionOptions) –
- Returns:
True if the selection was changed, false otherwise.
- Return type:
- 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:
element_list (TypedElementList) –
selection_options (TypedElementSelectionOptions) –
- Returns:
True if the selection was changed, false otherwise.
- Return type: