How to open scene via EditorPlugin?

Godot Version

4.2.1

Question

Is there any way to open a scene (in the editor, in editing mode) via EditorPlugin or EditorScript with @tool through a path? And is there a way to select (open in the inspector) a node from that open scene?

Solved (thanks @mrcdk)

EditorInterface.open_scene_from_path(scene_path)
EditorInterface.edit_node(EditorInterface.get_edited_scene_root().find_child(node_name))

EditorInterface.open_scene_from_path()

1 Like

Worked, thank you. I’m trying to select the node using
EditorInterface.get_selection().select(get_editor_interface().get_edited_scene_root().get_node(node_path))
But it doesn’t work, do you know how to do that?

EditorInterface.edit_node()

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.