How to "activate" a custom EditorInspectorPlugin in GDScript

Godot Version

v4.2.1.stable.official [b09f793f5]

Question

I have an EditorPlugin that creates a custom MyDock which is a tree similar in structure to the SceneTree. MyDock allows creating a hierarchy of custom Resources. I’ve created custom EditorInspectorPlugins for each of the custom resources. What I want to do is when an item in MyDock is selected to have the appropriate custom inspector to show in the Inspector in the same way selecting a node in the SceneTree shows the appropriate inspector.

I tried sleuthing the Godot editor source but I’m not a C++ expert so I’m not finding how the SceneTree activates the appropriate Inspector.

Thanks in advance for any help.

I think I found what I need. EditorInterface.inspect_object().

You should provide some code, but just assuming:

If you already have added the inspector plugins with add_inspector_plugin and your inspector plugins _can_handle your custom resource types, the only thing left is making your custom dock call EditorInterface.edit_resource(<the selected resource>)

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