From 7e89ec2cd84faf27d53e82ec7fccd8a22e2ba6a2 Mon Sep 17 00:00:00 2001 From: Tomasz Chabora Date: Tue, 10 Sep 2019 14:43:46 +0200 Subject: Preserve folding when sub-scene is changed --- editor/editor_node.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'editor') diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index a1998a1d7c..d50f31374c 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -3133,7 +3133,14 @@ void EditorNode::_clear_undo_history() { void EditorNode::set_current_scene(int p_idx) { + //Save the folding in case the scene gets reloaded. + if (editor_data.get_scene_path(p_idx) != "") + editor_folding.save_scene_folding(editor_data.get_edited_scene_root(p_idx), editor_data.get_scene_path(p_idx)); + if (editor_data.check_and_update_scene(p_idx)) { + if (editor_data.get_scene_path(p_idx) != "") + editor_folding.load_scene_folding(editor_data.get_edited_scene_root(p_idx), editor_data.get_scene_path(p_idx)); + call_deferred("_clear_undo_history"); } -- cgit v1.2.3