Skip to content

Improve support for Properties in NodePath exports#121683

Open
Komariarii wants to merge 1 commit into
godotengine:masterfrom
Komariarii:export-property-path
Open

Improve support for Properties in NodePath exports#121683
Komariarii wants to merge 1 commit into
godotengine:masterfrom
Komariarii:export-property-path

Conversation

@Komariarii

@Komariarii Komariarii commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What problem(s) does this PR solve?

Partially works towards godotengine/godot-proposals#231

This PR touches up the EditorPropertyNodePath class a bit to better support properties, while the main improvement in this PR is the support of drag and drop, there is some logic bundled for implementing a new @export_property_path attribute which is the goal of the proposal. I'm not familiar with GDScript or its processes (aside from basic bindings).

2026-07-23_04-14-10.mp4

This PR also includes a new internal helper method for NodePath called "with_subpaths", this shrinks an otherwise cumbersome NodePath construction to a much more readable state.
Before example:

const NodePath path = NodePath(adding_property_path.get_names(), {p_name}, adding_property_path.is_absolute());

After example:

const NodePath path = adding_property_path.with_subnames({p_name});

While I would like to expose this to GDScript, for similar reasons as above I'm not sure what the correct way of binding it is, as the helper takes a Vector of StringNames, which as far as I know isn't supported by the binding layer.

Additional information

From a quick test, this has no compatibility issues, I was able to update a 4.7 project with a manually typed property and it updated to include the new type icon just fine.

While this PR does not add the ability to access the Property Selector or the filtering included in this PR, it will mean that the PR that follows this up is completely self-contained in GDScript, and there (hopefully) shouldn't be any changes required in this area to support a @export_property_path attribute. Regardless, I've tested the currently unused code and the filtering and selector works as expected, they just need to be wired up.

Here is a demonstration of property selector enabled with a filter of bool and float:
(reminder that this functionality is not accessible yet)

2026-07-23_07-25-44.mp4

I believe this qualifies as a feature PR, and I don't believe I'm at the requirement quite yet (one merged PR away I believe?), but seeing how old the proposal had me interested enough in doing it for fun, I can mark this as a draft until the requirement is met if desired.

Should also be noted that I am still rather unfamiliar with C++ so if any of my decisions look strange it's most certainly that. Any code feedback is always highly appreciated.


No AI was used in the creation or process of this PR

@Komariarii
Komariarii force-pushed the export-property-path branch from 87d8529 to 3da63d0 Compare July 23, 2026 12:13
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.

2 participants