Fixed export var default value in PackedScene when script is not loaded in editor
(cherry picked from commit 4e14eefd94
)
This commit is contained in:
parent
54eabaad8c
commit
cefaa6fb06
1 changed files with 5 additions and 1 deletions
|
@ -481,6 +481,11 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map
|
||||||
p_node->get_property_list(&plist);
|
p_node->get_property_list(&plist);
|
||||||
StringName type = p_node->get_class();
|
StringName type = p_node->get_class();
|
||||||
|
|
||||||
|
Ref<Script> script = p_node->get_script();
|
||||||
|
if (script.is_valid()) {
|
||||||
|
script->update_exports();
|
||||||
|
}
|
||||||
|
|
||||||
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
|
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
|
||||||
|
|
||||||
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
|
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
|
||||||
|
@ -497,7 +502,6 @@ Error SceneState::_parse_node(Node *p_owner, Node *p_node, int p_parent_idx, Map
|
||||||
isdefault = bool(Variant::evaluate(Variant::OP_EQUAL, value, default_value));
|
isdefault = bool(Variant::evaluate(Variant::OP_EQUAL, value, default_value));
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Script> script = p_node->get_script();
|
|
||||||
if (!isdefault && script.is_valid() && script->get_property_default_value(name, default_value)) {
|
if (!isdefault && script.is_valid() && script->get_property_default_value(name, default_value)) {
|
||||||
isdefault = bool(Variant::evaluate(Variant::OP_EQUAL, value, default_value));
|
isdefault = bool(Variant::evaluate(Variant::OP_EQUAL, value, default_value));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue