Editor Inspector does not work!

Godot Version

4.2.1

Question

made a new project added inspectorPlugin.gd:

extends EditorInspectorPlugin

func can_handle(object):
	return true

func parse_begin(object):
	var label = Label.new()
	label.set_text("test!!!!!!")
	add_custom_control(label)

then added addons folder and plugin.gd:

@tool
extends EditorPlugin
var plugin

func _enter_tree():
	plugin = preload("res://addons/inspectorPlugin.gd").new()
	add_inspector_plugin(plugin)
	print("ready!")


func _exit_tree():
	remove_inspector_plugin(plugin)

then added the plugin.cgf file:

[plugin]
name="InspectorPlugin"
description="extends inspector"
author="Me"
version="1.0.0"
script="plugin.gd"

then went project-> project settings and enabled inspector Plugin under plgin tab
get the output message “ready!”

looked in the inspector and made several nodes but the “test!!!” label is nowhere to be found. whats wrong here??

Try making the inspector plugin script a @tool script too.

now I have:

@tool
extends EditorInspectorPlugin

func can_handle(object):
	return true

func parse_begin(object):
	#if category == "Node3D":
	var label = Label.new()
	label.set_text("test wdlssd slf sljf sljfslf sjlsfj")
	add_custom_control(label)

but it still doesnt work. I dont know what im doing wrong :frowning:

ive tried moving the files around.

I have:

addons / inspectorPlugin:
plugin.cfg
plugin.gd
addons / inspectorPlugin / inspector:
inspectorPlugin.gd

and of course I changed in plugin.gd:
plugin = preload(“res://addons//inspectorPlugin/inspector/inspectorPlugin.gd”).new()

but still nothing… is my setup wrong? Ive tried various other folder setups…
or mb something in my cade? must be in EditorInspectorPlugin kuz the plugin seems to print the message…

ok i found the error!!

should be:
_can_handle

i wrote:
can_handle

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