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

Method add_to_group

scene/main/node.cpp:2457–2479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2455}
2456
2457void Node::add_to_group(const StringName &p_identifier, bool p_persistent) {
2458 ERR_THREAD_GUARD
2459 ERR_FAIL_COND_MSG(p_identifier.is_empty(), vformat("Cannot add node '%s' to a group with an empty name.", get_name()));
2460
2461 if (data.grouped.has(p_identifier)) {
2462 return;
2463 }
2464
2465 GroupData gd;
2466
2467 if (data.tree) {
2468 gd.group = data.tree->add_to_group(p_identifier, this);
2469 } else {
2470 gd.group = nullptr;
2471 }
2472
2473 gd.persistent = p_persistent;
2474
2475 data.grouped[p_identifier] = gd;
2476 if (p_persistent) {
2477 _emit_editor_state_changed();
2478 }
2479}
2480
2481void Node::remove_from_group(const StringName &p_identifier) {
2482 ERR_THREAD_GUARD

Callers 7

instantiateMethod · 0.45
_propagate_enter_treeMethod · 0.45
_duplicateMethod · 0.45
replace_byMethod · 0.45
test_node.hFile · 0.45

Calls 4

vformatFunction · 0.85
get_nameFunction · 0.50
is_emptyMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected