summaryrefslogtreecommitdiffstats
path: root/core/string/node_path.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2022-07-02 00:17:21 +0200
committerGitHub <noreply@github.com>2022-07-02 00:17:21 +0200
commita2459c7d35eeaeea8b1d4fa9ce6c9cbe74f11643 (patch)
treec52f05eddaf57d2b54e4df061ecf354a8b3ea133 /core/string/node_path.cpp
parentd67691fbd6c1335caf523a2601450733bb4f101f (diff)
parentdc43cfc830e7e602ad5aa1f59ceaa82e344dd378 (diff)
downloadredot-engine-a2459c7d35eeaeea8b1d4fa9ce6c9cbe74f11643.tar.gz
Merge pull request #61610 from TokageItLab/importer-retarget-registered-gdhumanoid
Diffstat (limited to 'core/string/node_path.cpp')
-rw-r--r--core/string/node_path.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/string/node_path.cpp b/core/string/node_path.cpp
index 238897c2b1..30fa434fad 100644
--- a/core/string/node_path.cpp
+++ b/core/string/node_path.cpp
@@ -199,6 +199,21 @@ Vector<StringName> NodePath::get_subnames() const {
return Vector<StringName>();
}
+StringName NodePath::get_concatenated_names() const {
+ ERR_FAIL_COND_V(!data, StringName());
+
+ if (!data->concatenated_path) {
+ int pc = data->path.size();
+ String concatenated;
+ const StringName *sn = data->path.ptr();
+ for (int i = 0; i < pc; i++) {
+ concatenated += i == 0 ? sn[i].operator String() : "/" + sn[i];
+ }
+ data->concatenated_path = concatenated;
+ }
+ return data->concatenated_path;
+}
+
StringName NodePath::get_concatenated_subnames() const {
ERR_FAIL_COND_V(!data, StringName());