diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index ee16c61c897..bb02172b1a8 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -547,6 +547,7 @@ Variant EditorData::instantiate_custom_type(const String &p_type, const String & if (n) { n->set_name(p_type); } + n->set_meta(SceneStringName(_custom_type_script), script); ((Object *)ob)->set_script(script); return ob; } @@ -1008,6 +1009,7 @@ Variant EditorData::script_class_instance(const String &p_class) { // Store in a variant to initialize the refcount if needed. Variant obj = ClassDB::instantiate(script->get_instance_base_type()); if (obj) { + Object::cast_to(obj)->set_meta(SceneStringName(_custom_type_script), script); obj.operator Object *()->set_script(script); } return obj; diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index d88fb134f16..e57328911dd 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4672,6 +4672,11 @@ void EditorNode::stop_child_process(OS::ProcessID p_pid) { Ref