Open Goicox opened 2 months ago
Please try to read the README again after the update. And tell me if it solved your problem.
Thank you for updating the README. Still, I do not know how to make it work. I get inspector = null in the _ready method.
I get inspector = null in the _ready method.
What kind of object do you think
Inspector
should return in theget_object
method? Read the example more carefully. You should callinspector.set_object()
and assign your object.
Example:
@onready var inspector: Inspector = $Inspector
func _ready() -> void:
# Place for YOUR OBJECT.
var example_object := ExampleClass.new()
# Assign YOUR object to Inspector.
inspector.set_object(example_object)
class ExampleClass:
@export var check: bool = true
@export_range(0, 100) var number_i: int = 42
@export_range(0, 100) var number_f: float = PI
Thank you for the feedback. I just wanted to let you know that now it works.
I was getting inspector = null in the _ready method since the Inspector should be ObjectInspector (at least if the ObjectInspector is not renamed to something else).
@onready var inspector: Inspector = $ObjectInspector
Now regarding the second part of the README, I am not able to use the following:
I am getting:
Static function "add_description()" not found in base "Inspector". Static function "get_object_property_description()" not found in base "Inspector".
Thank you in advance for your help.
@onready var inspector: Inspector = $ObjectInspector
The $
symbol is equivalent to calling the get_node()
function, so it is important to specify the correct path to the node.
Inspector.add_description #Inspector.get_object_property_description
@onready var inspector: Inspector = $ObjectInspector
func _ready() -> void: Inspector.add_description("ExampleClass", "check", "Custom description for check")
#Inspector.add_script_property_description(ExampleClass, "check", "Custom description for check")
var example_object := ExampleClass.new()
inspector.set_object(example_object)
But I found a problem and it will NOT work for internal classes, you will have to declare `ExampleClass` in a separate file. I may try to work something out with that later.
It would be nice if it could expand the documentation, and perhaps you could add a short video showing how to use the plugin. I can load it in Godot, but I don't how to use it.
Thank you in advance!