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

Function _set_node_tree_owner

modules/gltf/gltf_document.cpp:6307–6327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6305}
6306
6307void _set_node_tree_owner(Node *p_current_node, Node *&p_scene_root) {
6308 // Note: p_scene_parent and p_scene_root must either both be null or both be valid.
6309 if (p_scene_root == nullptr) {
6310 // If the root node argument is null, this is the root node.
6311 p_scene_root = p_current_node;
6312 // If multiple nodes were generated under the root node, ensure they have the owner set.
6313 if (unlikely(p_current_node->get_child_count() > 0)) {
6314 Array args;
6315 args.append(p_scene_root);
6316 for (int i = 0; i < p_current_node->get_child_count(); i++) {
6317 Node *child = p_current_node->get_child(i);
6318 child->propagate_call(StringName("set_owner"), args);
6319 }
6320 }
6321 } else {
6322 // Add the node we generated and set the owner to the scene root.
6323 Array args;
6324 args.append(p_scene_root);
6325 p_current_node->propagate_call(StringName("set_owner"), args);
6326 }
6327}
6328
6329bool GLTFDocument::_does_skinned_mesh_require_placeholder_node(Ref<GLTFState> p_state, Ref<GLTFNode> p_gltf_node) {
6330 if (p_gltf_node->skin < 0) {

Callers 2

_generate_scene_nodeMethod · 0.85

Calls 5

propagate_callMethod · 0.80
StringNameClass · 0.50
get_child_countMethod · 0.45
appendMethod · 0.45
get_childMethod · 0.45

Tested by

no test coverage detected