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?

Awesome, thanks!
Worked for me

so where should i use this? in plugin script?

yep! Anywhere in a plugin script

1 Like

Hey! Did this get a solution? The breadcrumb of replies suggests that it did, however I do not see the original answer…

EDIT: Think I found the solution! For others encountering this same question, the answer is EditorInterface.edit_node or EditorInterface.edit_resource

@forestherd Not sure what happened to the original comment that answered but I believe it was

EditorInterface.get_inspector().resource_selected.emit(resource, resource.resource_path)