From c018d02cdac5d571105fa8bedfcc41b692611ec5 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sun, 9 Feb 2020 14:21:10 +0800 Subject: [PATCH] Fixes broken scene created via New Resource (cherry picked from commit 9cff286de1d56577dc8f6979d2b0d41c397ca7c7) --- editor/filesystem_dock.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 5041441ac32..684942dbade 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1782,6 +1782,14 @@ void FileSystemDock::_resource_created() const { Resource *r = Object::cast_to(c); ERR_FAIL_COND(!r); + PackedScene *scene = Object::cast_to(r); + if (scene) { + Node *node = memnew(Node); + node->set_name("Node"); + scene->pack(node); + memdelete(node); + } + REF res(r); editor->push_item(c);