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

Method remove

editor/scene/scene_tree_editor.cpp:2430–2468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2428}
2429
2430void SceneTreeEditor::NodeCache::remove(Node *p_node, bool p_recursive) {
2431 if (!p_node) {
2432 return;
2433 }
2434
2435 if (p_node == editor->selected) {
2436 editor->selected = nullptr;
2437 }
2438
2439 if (p_node == current_pinned_node) {
2440 current_pinned_node = nullptr;
2441 current_has_pin = false;
2442 }
2443
2444 editor->marked.erase(p_node);
2445
2446 HashMap<Node *, CachedNode>::Iterator I = cache.find(p_node);
2447 if (I) {
2448 if (p_recursive) {
2449 int cc = p_node->get_child_count(false);
2450
2451 for (int i = 0; i < cc; i++) {
2452 remove(p_node->get_child(i, false), p_recursive);
2453 }
2454 }
2455
2456 if (current_scene_node != p_node) {
2457 // Do not remove from the Tree control here. See delete_pending below.
2458 I->value.item->deselect(0);
2459 I->value.delete_serial = delete_serial;
2460 I->value.index = -1;
2461 I->value.cache_iterator = I;
2462 to_delete.insert(&I->value);
2463 } else {
2464 // If it is the root node, we leave the TreeItem and reuse it later.
2465 cache.remove(I);
2466 }
2467 }
2468}
2469
2470void SceneTreeEditor::NodeCache::mark_dirty(Node *p_node, bool p_parents) {
2471 Node *node = p_node;

Callers 15

make_translationsFunction · 0.45
resetMethod · 0.45
update_monitorsMethod · 0.45
_update_node_subtreeMethod · 0.45
_node_removedMethod · 0.45
delete_pendingMethod · 0.45
remove_gizmo_bvh_nodeMethod · 0.45
_update_propertiesMethod · 0.45
_discard_fileMethod · 0.45
_notificationMethod · 0.45
_update_scene_groupsMethod · 0.45

Calls 6

eraseMethod · 0.45
findMethod · 0.45
get_child_countMethod · 0.45
get_childMethod · 0.45
deselectMethod · 0.45
insertMethod · 0.45

Tested by 1

_notificationMethod · 0.36