Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export EditorInspector::instantiate_property_editor for use by plugins #87375

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

limbonaut
Copy link
Contributor

@limbonaut limbonaut commented Jan 19, 2024

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: closes godotengine/godot-proposals#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 limbonaut requested a review from a team as a code owner January 19, 2024 15:08
@AThousandShips AThousandShips added this to the 4.x milestone Jan 19, 2024
@limbonaut limbonaut marked this pull request as draft January 19, 2024 19:00
@limbonaut
Copy link
Contributor Author

I'll update it, and make a demo.

@limbonaut limbonaut force-pushed the instantiate_property_editor branch 2 times, most recently from 648fd26 to 5e2bc4c Compare January 19, 2024 22:50
@limbonaut limbonaut marked this pull request as ready for review January 19, 2024 23:13
@limbonaut limbonaut force-pushed the instantiate_property_editor branch from 5e2bc4c to c19510b Compare January 20, 2024 18:28
@limbonaut limbonaut force-pushed the instantiate_property_editor branch from c19510b to fa6135e Compare March 17, 2024 22:26
@limbonaut
Copy link
Contributor Author

limbonaut commented Mar 17, 2024

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

@akien-mga akien-mga modified the milestones: 4.x, 4.4 Nov 11, 2024
@akien-mga akien-mga requested a review from KoBeWi November 11, 2024 14:51
And export useful properties and methods in the `EditorProperty` class.
@limbonaut limbonaut force-pushed the instantiate_property_editor branch from fa6135e to 803fa8f Compare December 7, 2024 13:08
@limbonaut limbonaut requested a review from a team as a code owner December 7, 2024 13:08
@limbonaut limbonaut changed the title Export EditorInspector::instantiate_property_editor to use by plugins Export EditorInspector::instantiate_property_editor for use by plugins Dec 7, 2024
@Repiteo Repiteo merged commit 94711ac into godotengine:master Dec 9, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 9, 2024

Thanks! Congratulations on your first merged contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export EditorInspector::instantiate_property_editor for plugin development in the Godot API
7 participants