Fixes broken scene created via New Resource
(cherry picked from commit 9cff286de1
)
This commit is contained in:
parent
6380943831
commit
c018d02cda
1 changed files with 8 additions and 0 deletions
|
@ -1782,6 +1782,14 @@ void FileSystemDock::_resource_created() const {
|
||||||
Resource *r = Object::cast_to<Resource>(c);
|
Resource *r = Object::cast_to<Resource>(c);
|
||||||
ERR_FAIL_COND(!r);
|
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);
|
REF res(r);
|
||||||
editor->push_item(c);
|
editor->push_item(c);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue