diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-02-10 10:37:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-10 10:37:58 +0100 |
commit | b7f844a2e55626c70a53542d14f3afb1f0b53e72 (patch) | |
tree | 77c82ccb4b5ba0123c44e24807894312bf36e715 /editor/filesystem_dock.cpp | |
parent | 0b9f0cd4124a5187decf27e11b676ce848a1d2a1 (diff) | |
parent | 9cff286de1d56577dc8f6979d2b0d41c397ca7c7 (diff) |
Merge pull request #36043 from timothyqiu/packed-scene-resource
Fixes broken scene created via New Resource
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r-- | editor/filesystem_dock.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 5041441ac3..684942dbad 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<Resource>(c); ERR_FAIL_COND(!r); + PackedScene *scene = Object::cast_to<PackedScene>(r); + if (scene) { + Node *node = memnew(Node); + node->set_name("Node"); + scene->pack(node); + memdelete(node); + } + REF res(r); editor->push_item(c); |