Godot version 4.3.stable
Question
I’m trying to make a plugin in which I can have multiple inspectors open. Firstly I’m just trying to see if duplicating the inspector and adding it to a plugin is even possible. Has anyone done this before?
Attempts:
I played around with the code below in a Dock plugin. The EditorInspector instance shows up as a blank box, its not populated with anything and isn’t interactable. Is there something I’m missing to set up an instance of the inspector like the inspector dock in the editor?
@tool
extends Control
var insp:EditorInspector
func _ready() -> void:
insp = EditorInspector.new()
# this doesn't work either
# insp = EditorInterface.get_inspector().duplicate()
add_child(insp)
insp.set_anchors_preset(Control.PRESET_FULL_RECT)
func test():
var resource = ResourceLoader.load("res://some_resource.tres")
insp.resource_selected.emit(resource, resource.resource_path)
# This opens the resource in the actual inspector dock
# EditorInterface.get_inspector().resource_selected.emit(resource, resource.resource_path)
func _on_button_pressed() -> void:
test()