Adding Property Aliases for Cleaner Usability #11474
egirlmilkers
started this conversation in
Engine Core
Replies: 3 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
-
Not an exact copy, but may be related: |
Beta Was this translation helpful? Give feedback.
0 replies
-
@theraot @dalexeev |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I propose introducing property aliases to Godot, similar to how they are implemented in QML. Property aliases ideally would provide a way to link exported (maybe even non-exported) variables directly to existing properties of nodes, making it much easier to manage and expose specific properties for a clean and efficient user experience.
This feature would streamline workflows, especially for complex scenes or prefabs, by enabling developers to interact with specific properties of child nodes without delving into their hierarchy.
I KNOW that you can make getter/setters that change these properties but that would explicitly only work during runtime and wont update itself live in the viewer which can make certain workflows complex.
What Do I Mean By Property Aliases?
A property alias allows you to create an exported variable that directly references an existing property, essentially acting as a shortcut or mirror. This is particularly useful when you want to expose specific child node properties to the inspector without manually navigating through the node tree.
Example in QML
In QML, property aliases are used like this:
This example links
okEnabled
tookAction.enabled
, and so on. This way, you can easily control these properties from a single place, simplifying your workflow.Proposed Godot Implementation
Here’s how this could look:
Or maybe something simpler like this:
In both cases, these properties would be more directly available in the inspector/editor, the idea is that they would be directly reflecting and updating the corresponding child node properties.
Why This Feature Matters
1. Cleaner User Experience
Property aliases allow developers to surface only the most relevant properties to the inspector, improving usability for designers and developers. For example, a scene prefab for a new Control element can essentially "pin" properties to the top of the inspector for live-view in the editor.
2. Streamlined Workflow
By enabling developers to interact with child node properties without manually traversing the hierarchy, property aliases significantly reduce boilerplate code and the risk of errors.
Without this feature, the alternative involves either:
3. Enhanced Inspector Customization
Exposing only the necessary properties through aliases keeps the inspector clean and focused, especially for prefabs or reusable scenes.
I believe this feature could greatly enhance the Godot experience for many users. I'd love to hear your thoughts, feedback, or suggestions! I know my example may not be the best but if you ever worked with QML before you would know how efficient the implementation of something as simple as property aliases are and can be.
Qt is open-source so you can see how they do the alias properties. Perhaps my idea of an alias being able to invert an existing bool property is not ideal.
Beta Was this translation helpful? Give feedback.
All reactions