summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_node.cpp6
-rw-r--r--editor/import/editor_import_collada.cpp4
-rw-r--r--editor/import/resource_importer_obj.cpp2
-rw-r--r--editor/import/resource_importer_scene.cpp18
-rw-r--r--editor/import/scene_import_settings.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--editor/plugins/mesh_instance_3d_editor_plugin.cpp12
-rw-r--r--editor/scene_tree_dock.cpp2
8 files changed, 23 insertions, 25 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 891705da98..7a9cc2d084 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -3347,7 +3347,7 @@ void EditorNode::set_edited_scene(Node *p_scene) {
if (p_scene) {
if (p_scene->get_parent() != scene_root) {
- scene_root->add_child(p_scene);
+ scene_root->add_child(p_scene, true);
}
}
}
@@ -3479,7 +3479,7 @@ void EditorNode::set_current_scene(int p_idx) {
if (new_scene) {
if (new_scene->get_parent() != scene_root) {
- scene_root->add_child(new_scene);
+ scene_root->add_child(new_scene, true);
}
}
@@ -7115,8 +7115,6 @@ EditorNode::EditorNode() {
_build_icon_type_cache();
- Node::set_human_readable_collision_renaming(true);
-
pick_main_scene = memnew(ConfirmationDialog);
gui_base->add_child(pick_main_scene);
pick_main_scene->get_ok_button()->set_text(TTR("Select"));
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index ac8adedf2f..47d217be78 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -314,7 +314,7 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Node3D *p_parent) {
xf = collada.fix_transform(xf) * p_node->post_transform;
node->set_transform(xf);
- p_parent->add_child(node);
+ p_parent->add_child(node, true);
node->set_owner(scene);
if (p_node->empty_draw_type != "") {
@@ -1805,7 +1805,7 @@ Node *EditorSceneFormatImporterCollada::import_scene(const String &p_path, uint3
ap->add_animation(name, state.animations[i]);
}
- state.scene->add_child(ap);
+ state.scene->add_child(ap, true);
ap->set_owner(state.scene);
}
diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp
index 4f75faedcb..01af75c338 100644
--- a/editor/import/resource_importer_obj.cpp
+++ b/editor/import/resource_importer_obj.cpp
@@ -448,7 +448,7 @@ Node *EditorOBJImporter::import_scene(const String &p_path, uint32_t p_flags, in
ImporterMeshInstance3D *mi = memnew(ImporterMeshInstance3D);
mi->set_mesh(mesh);
mi->set_name(m->get_name());
- scene->add_child(mi);
+ scene->add_child(mi, true);
mi->set_owner(scene);
}
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index 319e5ee25f..18461593f2 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -501,7 +501,7 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<I
sphereShape->set_radius(1);
colshape->set_shape(sphereShape);
}
- sb->add_child(colshape);
+ sb->add_child(colshape, true);
colshape->set_owner(sb->get_owner());
}
@@ -527,7 +527,7 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<I
rigid_body->set_transform(mi->get_transform());
p_node = rigid_body;
mi->set_transform(Transform3D());
- rigid_body->add_child(mi);
+ rigid_body->add_child(mi, true);
mi->set_owner(rigid_body->get_owner());
_add_shapes(rigid_body, shapes);
@@ -565,7 +565,7 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<I
if (shapes.size()) {
StaticBody3D *col = memnew(StaticBody3D);
- mi->add_child(col);
+ mi->add_child(col, true);
col->set_owner(mi->get_owner());
_add_shapes(col, shapes);
@@ -613,7 +613,7 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<I
if (shapes.size()) {
StaticBody3D *col = memnew(StaticBody3D);
- p_node->add_child(col);
+ p_node->add_child(col, true);
col->set_owner(p_node->get_owner());
_add_shapes(col, shapes);
@@ -748,7 +748,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Map<Ref<
switch (mesh_physics_mode) {
case MESH_PHYSICS_MESH_AND_STATIC_COLLIDER: {
StaticBody3D *col = memnew(StaticBody3D);
- p_node->add_child(col);
+ p_node->add_child(col, true);
col->set_owner(p_node->get_owner());
col->set_transform(get_collision_shapes_transform(node_settings));
base = col;
@@ -760,7 +760,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Map<Ref<
rigid_body->set_transform(mi->get_transform() * get_collision_shapes_transform(node_settings));
p_node = rigid_body;
mi->set_transform(Transform3D());
- rigid_body->add_child(mi);
+ rigid_body->add_child(mi, true);
mi->set_owner(rigid_body->get_owner());
base = rigid_body;
} break;
@@ -789,7 +789,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Map<Ref<
for (const Ref<Shape3D> &E : shapes) {
CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(E);
- base->add_child(cshape);
+ base->add_child(cshape, true);
cshape->set_owner(base->get_owner());
idx++;
@@ -822,7 +822,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Map<Ref<
memdelete(p_node);
p_node = nmi;
} else {
- mi->add_child(nmi);
+ mi->add_child(nmi, true);
nmi->set_owner(mi->get_owner());
}
}
@@ -1657,7 +1657,7 @@ void ResourceImporterScene::_add_shapes(Node *p_node, const Vector<Ref<Shape3D>>
for (const Ref<Shape3D> &E : p_shapes) {
CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(E);
- p_node->add_child(cshape);
+ p_node->add_child(cshape, true);
cshape->set_owner(p_node->get_owner());
}
diff --git a/editor/import/scene_import_settings.cpp b/editor/import/scene_import_settings.cpp
index 95a96f9e26..9b9320ad6d 100644
--- a/editor/import/scene_import_settings.cpp
+++ b/editor/import/scene_import_settings.cpp
@@ -327,7 +327,7 @@ void SceneImportSettings::_fill_scene(Node *p_node, TreeItem *p_parent_item) {
MeshInstance3D *collider_view = memnew(MeshInstance3D);
collider_view->set_name("collider_view");
collider_view->set_visible(false);
- mesh_node->add_child(collider_view);
+ mesh_node->add_child(collider_view, true);
collider_view->set_owner(mesh_node);
Transform3D accum_xform;
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 8935f715e6..40f9e8c7b3 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -5842,7 +5842,7 @@ void CanvasItemEditorViewport::_create_nodes(Node *parent, Node *child, String &
Ref<Texture2D> texture = Ref<Texture2D>(Object::cast_to<Texture2D>(ResourceCache::get(path)));
if (parent) {
- editor_data->get_undo_redo().add_do_method(parent, "add_child", child);
+ editor_data->get_undo_redo().add_do_method(parent, "add_child", child, true);
editor_data->get_undo_redo().add_do_method(child, "set_owner", editor->get_edited_scene());
editor_data->get_undo_redo().add_do_reference(child);
editor_data->get_undo_redo().add_undo_method(parent, "remove_child", child);
diff --git a/editor/plugins/mesh_instance_3d_editor_plugin.cpp b/editor/plugins/mesh_instance_3d_editor_plugin.cpp
index 574d3ef27e..7a85c5167b 100644
--- a/editor/plugins/mesh_instance_3d_editor_plugin.cpp
+++ b/editor/plugins/mesh_instance_3d_editor_plugin.cpp
@@ -79,7 +79,7 @@ void MeshInstance3DEditor::_menu_option(int p_option) {
Node *owner = node == get_tree()->get_edited_scene_root() ? node : node->get_owner();
ur->create_action(TTR("Create Static Trimesh Body"));
- ur->add_do_method(node, "add_child", body);
+ ur->add_do_method(node, "add_child", body, true);
ur->add_do_method(body, "set_owner", owner);
ur->add_do_method(cshape, "set_owner", owner);
ur->add_do_reference(body);
@@ -113,7 +113,7 @@ void MeshInstance3DEditor::_menu_option(int p_option) {
Node *owner = instance == get_tree()->get_edited_scene_root() ? instance : instance->get_owner();
- ur->add_do_method(instance, "add_child", body);
+ ur->add_do_method(instance, "add_child", body, true);
ur->add_do_method(body, "set_owner", owner);
ur->add_do_method(cshape, "set_owner", owner);
ur->add_do_reference(body);
@@ -146,7 +146,7 @@ void MeshInstance3DEditor::_menu_option(int p_option) {
ur->create_action(TTR("Create Trimesh Static Shape"));
- ur->add_do_method(node->get_parent(), "add_child", cshape);
+ ur->add_do_method(node->get_parent(), "add_child", cshape, true);
ur->add_do_method(node->get_parent(), "move_child", cshape, node->get_index() + 1);
ur->add_do_method(cshape, "set_owner", owner);
ur->add_do_reference(cshape);
@@ -185,7 +185,7 @@ void MeshInstance3DEditor::_menu_option(int p_option) {
Node *owner = node->get_owner();
- ur->add_do_method(node->get_parent(), "add_child", cshape);
+ ur->add_do_method(node->get_parent(), "add_child", cshape, true);
ur->add_do_method(node->get_parent(), "move_child", cshape, node->get_index() + 1);
ur->add_do_method(cshape, "set_owner", owner);
ur->add_do_reference(cshape);
@@ -247,7 +247,7 @@ void MeshInstance3DEditor::_menu_option(int p_option) {
UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
ur->create_action(TTR("Create Navigation Mesh"));
- ur->add_do_method(node, "add_child", nmi);
+ ur->add_do_method(node, "add_child", nmi, true);
ur->add_do_method(nmi, "set_owner", owner);
ur->add_do_reference(nmi);
@@ -426,7 +426,7 @@ void MeshInstance3DEditor::_create_outline_mesh() {
ur->create_action(TTR("Create Outline"));
- ur->add_do_method(node, "add_child", mi);
+ ur->add_do_method(node, "add_child", mi, true);
ur->add_do_method(mi, "set_owner", owner);
ur->add_do_reference(mi);
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 4a59eb4fb3..4a11051ffe 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -2153,7 +2153,7 @@ void SceneTreeDock::_do_create(Node *p_parent) {
editor_data->get_undo_redo().create_action(TTR("Create Node"));
if (edited_scene) {
- editor_data->get_undo_redo().add_do_method(p_parent, "add_child", child);
+ editor_data->get_undo_redo().add_do_method(p_parent, "add_child", child, true);
editor_data->get_undo_redo().add_do_method(child, "set_owner", edited_scene);
editor_data->get_undo_redo().add_do_method(editor_selection, "clear");
editor_data->get_undo_redo().add_do_method(editor_selection, "add_node", child);