MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _focus_node

Method _focus_node

editor/docks/scene_tree_dock.cpp:4132–4143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4130}
4131
4132void SceneTreeDock::_focus_node() {
4133 Node *node = scene_tree->get_selected();
4134 ERR_FAIL_NULL(node);
4135
4136 if (node->is_class("CanvasItem")) {
4137 CanvasItemEditorPlugin *editor = Object::cast_to<CanvasItemEditorPlugin>(editor_data->get_editor_by_name("2D"));
4138 editor->get_canvas_item_editor()->focus_selection();
4139 } else {
4140 Node3DEditorPlugin *editor = Object::cast_to<Node3DEditorPlugin>(editor_data->get_editor_by_name("3D"));
4141 editor->get_spatial_editor()->get_editor_viewport(0)->focus_selection();
4142 }
4143}
4144
4145void SceneTreeDock::attach_script_to_selected(bool p_extend) {
4146 if (ScriptServer::get_language_count() == 0) {

Callers

nothing calls this directly

Calls 7

get_editor_by_nameMethod · 0.80
get_editor_viewportMethod · 0.80
get_spatial_editorMethod · 0.80
get_selectedMethod · 0.45
is_classMethod · 0.45
focus_selectionMethod · 0.45

Tested by

no test coverage detected