Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion editor/animation/animation_track_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4892,7 +4892,16 @@ PropertyInfo AnimationTrackEditor::_find_hint_for_track(int p_idx, NodePath &r_b

for (const PropertyInfo &E : pinfo) {
if (E.name == leftover_path[leftover_path.size() - 1]) {
return E;
PropertyInfo pi = E;

// See `PropertySelector::_update_search()`. `PropertySelector` makes an exception for script variables,
// displaying them even if `PROPERTY_USAGE_EDITOR` is not set. So, we need to compensate for this here
// to ensure the property is visible in the Inspector.
if (pi.usage & PROPERTY_USAGE_SCRIPT_VARIABLE) {
pi.usage |= PROPERTY_USAGE_EDITOR;
}

return pi;
}
}

Expand Down
20 changes: 17 additions & 3 deletions modules/gdscript/gdscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,26 @@ bool GDScript::_update_exports(bool *r_err, bool p_recursive_call, PlaceHolderSc

switch (member.type) {
case GDScriptParser::ClassNode::Member::VARIABLE: {
if (!member.variable->exported) {
continue;
// See `GDScriptCompiler::_prepare_compilation()`. The `PROPERTY_USAGE_SCRIPT_VARIABLE` flag
// isn't stored in `export_info`, but is set separately in the compiler. We need to replicate
// the same logic for placeholders.
PropertyInfo prop_info = member.variable->get_datatype().to_property_info(member.variable->identifier->name);
PropertyInfo export_info = member.variable->export_info;

if (member.variable->exported) {
if (member.variable->get_datatype().is_variant()) {
prop_info.type = export_info.type;
prop_info.class_name = export_info.class_name;
}
prop_info.hint = export_info.hint;
prop_info.hint_string = export_info.hint_string;
prop_info.usage = export_info.usage;
}
prop_info.usage |= PROPERTY_USAGE_SCRIPT_VARIABLE;

members_cache.push_back(member.variable->export_info);
Variant default_value = analyzer.make_variable_default_value(member.variable);

members_cache.push_back(prop_info);
member_default_values_cache[member.variable->identifier->name] = default_value;
} break;
case GDScriptParser::ClassNode::Member::SIGNAL: {
Expand Down