0 votes

Hey All,

As the title says, I don't understand how to use the edit() function from the EditorPlugin Class. If you could explain it that would be much appreciated.

The reason for my interest is to get my EditorInspectorPlugin to "notice" some nodes I am injecting into the inspector. The EditorInspectorPlugin description says:

"When an object is edited, the can_handle function is called"

I was trying to use it by calling it from the script of the node I was injecting into the inspector: EditorPlugin.edit(self) where EditorPlugin is an Autoload of the EditorPlugin.

Godot version 3.2.4 beta 4
in Engine by (586 points)

1 Answer

0 votes
Best answer

EditorPlugin.edit() is not a function you should call yourself. You can call it, but it will do nothing more than whatever you wrote inside. It's a function the editor is calling, when you select something like a node, or a resource.

To tell Godot to start editing an object, I think you can call EditorInterface.inspect_object: https://docs.godotengine.org/en/stable/classes/class_editorinterface.html#class-editorinterface-method-inspect-object
But I'm not really sure if that's what you are trying to do.

by (28,731 points)
selected by

Awesome! EditorInterface.inspect_object is what I was looking for.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.