GDScript: Fix PROPERTY_USAGE_SCRIPT_VARIABLE is not set for placeholder instance properties
#114345
+27
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Test script:
A user emailed me with a bug: properties exported using
@export_storagedon't work correctly in animation tracks. I examined the code and discovered two issues:1. For placeholder instance properties, the
PROPERTY_USAGE_SCRIPT_VARIABLEflag isn't set. This differs from runtime and tool scripts. This means that unexported properties or those exported withoutPROPERTY_USAGE_EDITORaren't displayed in the Property Selector without@tool, but are displayed with@tool:godot/modules/gdscript/gdscript_compiler.cpp
Lines 2877 to 2878 in 63227bb
2. The Property Selector makes an exception for script variables and displays them even if
PROPERTY_USAGE_EDITORis not set. This results in such properties being displayed in the animation editor without the Value field (for tool scripts or if you create an animation track for another property and then manually edit the node path).godot/editor/inspector/property_selector.cpp
Lines 134 to 136 in 63227bb