How to open a resource in the inspector from a custom plugin

Essentially I’d like to mimic the behavior of double clicking a resource from the file pane. When you double click a resource file it automatically pops up in the inspector.

Is there a way to feed a resource to the inspector when the user clicks a button on a plugin?

Hey, I tried quickly with one of my plugin, and you can do it by using the signal “resource_selected” in the EditorInspector class; Like this:

EditorInterface.get_inspector().resource_selected.emit([resource], [path_to_the_resource])
2 Likes

Awesome, thanks!
Worked for me

so where should i use this? in plugin script?

yep! Anywhere in a plugin script

1 Like