godot icon indicating copy to clipboard operation
godot copied to clipboard

Export `EditorInspector::instantiate_property_editor` to use by plugins

Open limbonaut opened this issue 1 year ago • 2 comments

This PR exports EditorInspector::instantiate_property_editor in the Godot API, so that plugin developers could reuse existing property editors in their projects. It also exports several useful properties and methods in the EditorProperty. Some of those properties are needed to implement custom inspectors (demo below).

See proposal: https://github.com/godotengine/godot-proposals/issues/8908

With this change, users can create a property editor like this:

EditorInspector.instantiate_property_editor(obj, TYPE_STRING, "some_property", PROPERTY_HINT_MULTILINE_TEXT, "", PROPERTY_USAGE_DEFAULT, false)

Test/demo project: Plugin that adds a custom inspector for a data object in the bottom panel: https://github.com/limbonaut/godot-custom-inspector-demo

image

limbonaut avatar Jan 19 '24 15:01 limbonaut

I'll update it, and make a demo.

limbonaut avatar Jan 19 '24 19:01 limbonaut

PR updated & rebased. And also updated the demo project, particularly fixed the issue with editing Packed*Array properties.

limbonaut avatar Mar 17 '24 22:03 limbonaut

Thanks! Congratulations on your first merged contribution! 🎉

Repiteo avatar Dec 09 '24 20:12 Repiteo