summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorabaire <erik.abair@gmail.com>2021-01-28 12:48:12 -0800
committerErik Abair <erik.abair@gmail.com>2021-02-24 08:22:27 -0800
commit61cc1c8624cdf2ef56b807c70f76dd96cc0ebcb7 (patch)
tree6e941c9222b788269c31352afeda108254e918fb /editor
parente5bb89cdd5e92fa6fdeff78aad08bf0cbfbcc692 (diff)
downloadredot-engine-61cc1c8624cdf2ef56b807c70f76dd96cc0ebcb7.tar.gz
Relaxes Node naming constraints in glTF documents to match the Editor.
Diffstat (limited to 'editor')
-rw-r--r--editor/scene_tree_editor.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index ce44a4bca1..02f88bee0e 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -767,9 +767,11 @@ void SceneTreeEditor::_renamed() {
return;
}
- String new_name = which->get_text(0);
- if (!Node::_validate_node_name(new_name)) {
- error->set_text(TTR("Invalid node name, the following characters are not allowed:") + "\n" + Node::invalid_character);
+ String raw_new_name = which->get_text(0);
+ String new_name = raw_new_name.validate_node_name();
+
+ if (new_name != raw_new_name) {
+ error->set_text(TTR("Invalid node name, the following characters are not allowed:") + "\n" + String::invalid_node_name_characters);
error->popup_centered();
if (new_name.is_empty()) {