1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-31 18:41:20 +00:00

Fix allow any descendant to be used as a Root Type in Scene Import

This commit is contained in:
Kody Van Ry
2025-07-20 14:51:26 -06:00
committed by shadowcow13
parent 71a9948157
commit 2554434cd9

View File

@@ -1386,6 +1386,13 @@ Node *ResourceImporterScene::_replace_node_with_type_and_script(Node *p_node, St
p_script = ResourceLoader::load(ScriptServer::get_global_class_path(p_node_type));
}
p_node_type = ScriptServer::get_global_class_base(p_node_type);
while (!p_node_type.is_empty()) {
if (ScriptServer::is_global_class(p_node_type)) {
p_node_type = ScriptServer::get_global_class_base(p_node_type);
} else {
break;
}
}
}
if (!p_node_type.is_empty() && p_node->get_class_name() != p_node_type) {
// If the user specified a Godot node type that does not match