Skip to content

Conversation

@dalexeev
Copy link
Member

Test script:

#@tool
extends Node

@export_storage var t: float:
    set(v):
        t = v
        print(t)

@export var t2: float

var t3: float

A user emailed me with a bug: properties exported using @export_storage don't work correctly in animation tracks. I examined the code and discovered two issues:

1. For placeholder instance properties, the PROPERTY_USAGE_SCRIPT_VARIABLE flag isn't set. This differs from runtime and tool scripts. This means that unexported properties or those exported without PROPERTY_USAGE_EDITOR aren't displayed in the Property Selector without @tool, but are displayed with @tool:

prop_info.usage |= PROPERTY_USAGE_SCRIPT_VARIABLE;
minfo.property_info = prop_info;

2. The Property Selector makes an exception for script variables and displays them even if PROPERTY_USAGE_EDITOR is 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).

if (!(E.usage & PROPERTY_USAGE_EDITOR) && !(E.usage & PROPERTY_USAGE_SCRIPT_VARIABLE)) {
continue;
}

@dalexeev dalexeev force-pushed the gds-fix-placeholder-usage-flags branch from c052d64 to 4e383c5 Compare December 26, 2025 13:22
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.

1 participant