MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / get_path

Method get_path

scene/main/node.cpp:2429–2450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2427}
2428
2429NodePath Node::get_path() const {
2430 ERR_FAIL_COND_V_MSG(!is_inside_tree(), NodePath(), "Cannot get path of node as it is not in a scene tree.");
2431
2432 if (data.path_cache) {
2433 return *data.path_cache;
2434 }
2435
2436 const Node *n = this;
2437
2438 Vector<StringName> path;
2439
2440 while (n) {
2441 path.push_back(n->get_name());
2442 n = n->data.parent;
2443 }
2444
2445 path.reverse();
2446
2447 data.path_cache = memnew(NodePath(path, true));
2448
2449 return *data.path_cache;
2450}
2451
2452bool Node::is_in_group(const StringName &p_identifier) const {
2453 ERR_THREAD_GUARD_V(false);

Callers 15

SceneDebuggerObjectMethod · 0.45
serializeMethod · 0.45
SceneDebuggerTreeMethod · 0.45
NavigationAgent2DClass · 0.45
_get_final_positionMethod · 0.45
_update_navigationMethod · 0.45
_is_last_waypointMethod · 0.45

Calls 4

NodePathClass · 0.50
push_backMethod · 0.45
get_nameMethod · 0.45
reverseMethod · 0.45

Tested by

no test coverage detected