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

Method _set_tree

scene/main/node.cpp:3368–3397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3366}
3367
3368void Node::_set_tree(SceneTree *p_tree) {
3369 SceneTree *tree_changed_a = nullptr;
3370 SceneTree *tree_changed_b = nullptr;
3371
3372 //ERR_FAIL_COND(p_scene && data.parent && !data.parent->data.scene); //nobug if both are null
3373
3374 if (data.tree) {
3375 _propagate_exit_tree();
3376
3377 tree_changed_a = data.tree;
3378 }
3379
3380 data.tree = p_tree;
3381
3382 if (data.tree) {
3383 _propagate_enter_tree();
3384 if (!data.parent || data.parent->data.ready_notified) { // No parent (root) or parent ready
3385 _propagate_ready(); //reverse_notification(NOTIFICATION_READY);
3386 }
3387
3388 tree_changed_b = data.tree;
3389 }
3390
3391 if (tree_changed_a) {
3392 tree_changed_a->tree_changed();
3393 }
3394 if (tree_changed_b) {
3395 tree_changed_b->tree_changed();
3396 }
3397}
3398
3399#ifdef DEBUG_ENABLED
3400static HashMap<ObjectID, List<String>> _print_orphan_nodes_map;

Callers 5

_add_child_nocheckMethod · 0.80
remove_childMethod · 0.80
initializeMethod · 0.80
finalizeMethod · 0.80
~SceneTreeMethod · 0.80

Calls 1

tree_changedMethod · 0.80

Tested by

no test coverage detected