-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Expose PropertySelector to scripting #7635
Comments
Very relevant proposal! Does the fact that this proposal exists and has a lot of support affect this proposal and it's PR at all? As in, should we favor a more general solution that exposes a bunch of editor classes, or is it okay to expose them piecemeal? |
This is kind of a crux here, exposing internal components is a major tying up of the functionality and interface of things, which has to have a very good reason |
I've edited the original post with a proposal for implementing |
Describe the project you are working on
An addon built with GDExtension that helps users create saving and loading systems for their games.
Describe the problem or limitation you are having in your project
I want to use the engine's
PropertySelector
dialog to provide a UI where users can select which properties of a given node they want to save/load.I can imagine this dialog would be useful in other plugins/addons as well (although admittedly I can't think of a concrete example other than my own project mentioned above).
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Exposing
PropertySelector
to scripting will allow users to select which properties they want to save/load using a familiar UI; the same one used inAnimationPlayer
andMultiplayerSynchronizer
.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Simply expose the existing
PropertySelector
https://github.com/godotengine/godot/blob/master/editor/property_selector.h to scripting. See draft PR for proposed implementation: godotengine/godot#81488.Edit: I received feedback that exposing
PropertySelector
directly is not a good idea because it couples the implementation with the API. Instead, it was recommended that I incorporate some ofPropertySelector
's functionality intoEditorInterface
. Here are my proposed additions toEditorInterface
.Note: emitting an
Array[NodePath]
instead of just aNodePath
let's you infer that the dialog was canceled (by checking whether the array is empty) and also allows multiple properties to be selected in principle.If this enhancement will not be used often, can it be worked around with a few lines of script?
I looked into recreating the
PropertySelector
in GDExtension, but there is currently no built-in way to list all the properties of a non-object Variant (see #2344).Is there a reason why this should be core and not an add-on in the asset library?
N/A
The text was updated successfully, but these errors were encountered: