Table of Contents

Class EditorSelection

Manages the SceneTree selection in the editor.

Inheritance
EditorSelection

Remarks

This object manages the SceneTree selection in the editor.

Note: This class shouldn't be instantiated directly. Instead, access the singleton using get_selection.

Methods

add_node(Node)

Adds a node to the selection.

Note: The newly selected node will not be automatically edited in the inspector. If you want to edit a node, use EditorInterface.edit_node.

void add_node(Node node)

Parameters

node Node

clear

Clear the selection.

void clear

get_selected_nodes

Returns the list of selected nodes.

Node[] get_selected_nodes

get_transformable_selected_nodes

Returns the list of selected nodes, optimized for transform operations (i.e. moving them, rotating, etc.). This list can be used to avoid situations where a node is selected and is also a child/grandchild.

Node[] get_transformable_selected_nodes

remove_node(Node)

Removes a node from the selection.

void remove_node(Node node)

Parameters

node Node

Events

selection_changed

Emitted when the selection changes.

signal selection_changed