Merge pull request #36043 from timothyqiu/packed-scene-resource

Fixes broken scene created via New Resource
This commit is contained in:
Rémi Verschelde 2020-02-10 10:37:58 +01:00 committed by GitHub
commit b7f844a2e5

View file

@ -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);