How does an editor plugin not lose focus on scene tree selection

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By annaSH

If you are in script editor and select a node in tree, it does not take you to 2d or 3d editor. I wish to add an editor with similar behavior, unlike the default which sends focus back.

Not sure that it’s helpful, but the behavior you mention is controlled by the following Editor setting:

Editor Settings | Text Editor | Behavior | Stay in Script Editor on Node Selected

With that option turned on (the default), selecting a node in the scene tree while in the script editor does not switch to the 2D/3D editor. If the options is off, the appropriate editor is presented upon node selection.

jgodfrey | 2023-03-19 23:35

That is somewhat helpful - I now know that the behavior I would like to prevent is somewhere in editor_node.cpp around lines 2469-2492, but I have no idea how I would edit this behavior without a PR to the engine.

annaSH | 2023-03-20 02:34