summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2021-10-21 16:46:07 +0200
committerkobewi <kobewi4e@gmail.com>2021-10-28 01:43:34 +0200
commitde4f29f458fd07d9fb132e38662359e2850c566c (patch)
tree97098883d5c6feb0d7edb0abb763d716b657ac83 /modules
parent9c9ec63e1dbd33cace4a988783f1130b4c3f06ad (diff)
Remove node_hrcr hack
Diffstat (limited to 'modules')
-rw-r--r--modules/fbx/editor_scene_importer_fbx.cpp2
-rw-r--r--modules/gltf/gltf_document.cpp16
2 files changed, 9 insertions, 9 deletions
diff --git a/modules/fbx/editor_scene_importer_fbx.cpp b/modules/fbx/editor_scene_importer_fbx.cpp
index 9bdeafbf91..b11c145599 100644
--- a/modules/fbx/editor_scene_importer_fbx.cpp
+++ b/modules/fbx/editor_scene_importer_fbx.cpp
@@ -843,7 +843,7 @@ Node3D *EditorSceneFormatImporterFBX::_generate_scene(
if (state.animation_player == nullptr) {
print_verbose("Creating animation player");
state.animation_player = memnew(AnimationPlayer);
- state.root->add_child(state.animation_player);
+ state.root->add_child(state.animation_player, true);
state.animation_player->set_owner(state.root_owner);
}
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index b8da3a713b..8a6dfb7735 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -5567,7 +5567,7 @@ void GLTFDocument::_generate_scene_node(Ref<GLTFState> state, Node *scene_parent
// Bone Attachment - Parent Case
BoneAttachment3D *bone_attachment = _generate_bone_attachment(state, active_skeleton, node_index, gltf_node->parent);
- scene_parent->add_child(bone_attachment);
+ scene_parent->add_child(bone_attachment, true);
bone_attachment->set_owner(scene_root);
// There is no gltf_node that represent this, so just directly create a unique name
@@ -5590,7 +5590,7 @@ void GLTFDocument::_generate_scene_node(Ref<GLTFState> state, Node *scene_parent
current_node = _generate_spatial(state, scene_parent, node_index);
}
- scene_parent->add_child(current_node);
+ scene_parent->add_child(current_node, true);
if (current_node != scene_root) {
current_node->set_owner(scene_root);
}
@@ -5620,7 +5620,7 @@ void GLTFDocument::_generate_skeleton_bone_node(Ref<GLTFState> state, Node *scen
// Bone Attachment - Direct Parented Skeleton Case
BoneAttachment3D *bone_attachment = _generate_bone_attachment(state, active_skeleton, node_index, gltf_node->parent);
- scene_parent->add_child(bone_attachment);
+ scene_parent->add_child(bone_attachment, true);
bone_attachment->set_owner(scene_root);
// There is no gltf_node that represent this, so just directly create a unique name
@@ -5634,7 +5634,7 @@ void GLTFDocument::_generate_skeleton_bone_node(Ref<GLTFState> state, Node *scen
// Add it to the scene if it has not already been added
if (skeleton->get_parent() == nullptr) {
- scene_parent->add_child(skeleton);
+ scene_parent->add_child(skeleton, true);
skeleton->set_owner(scene_root);
}
}
@@ -5648,7 +5648,7 @@ void GLTFDocument::_generate_skeleton_bone_node(Ref<GLTFState> state, Node *scen
// Bone Attachment - Same Node Case
BoneAttachment3D *bone_attachment = _generate_bone_attachment(state, active_skeleton, node_index, node_index);
- scene_parent->add_child(bone_attachment);
+ scene_parent->add_child(bone_attachment, true);
bone_attachment->set_owner(scene_root);
// There is no gltf_node that represent this, so just directly create a unique name
@@ -5668,7 +5668,7 @@ void GLTFDocument::_generate_skeleton_bone_node(Ref<GLTFState> state, Node *scen
current_node = _generate_light(state, scene_parent, node_index);
}
- scene_parent->add_child(current_node);
+ scene_parent->add_child(current_node, true);
if (current_node != scene_root) {
current_node->set_owner(scene_root);
}
@@ -6182,7 +6182,7 @@ void GLTFDocument::_process_mesh_instances(Ref<GLTFState> state, Node *scene_roo
ERR_CONTINUE_MSG(skeleton == nullptr, vformat("Unable to find Skeleton for node %d skin %d", node_i, skin_i));
mi->get_parent()->remove_child(mi);
- skeleton->add_child(mi);
+ skeleton->add_child(mi, true);
mi->set_owner(skeleton->get_owner());
mi->set_skin(state->skins.write[skin_i]->godot_skin);
@@ -6859,7 +6859,7 @@ Node *GLTFDocument::import_scene_gltf(const String &p_path, uint32_t p_flags, in
gltf_document->_process_mesh_instances(r_state, root);
if (r_state->animations.size()) {
AnimationPlayer *ap = memnew(AnimationPlayer);
- root->add_child(ap);
+ root->add_child(ap, true);
ap->set_owner(root);
for (int i = 0; i < r_state->animations.size(); i++) {
gltf_document->_import_animation(r_state, ap, i, p_bake_fps);