From 8b3400e634136f68c4ddc727d89cd6e111253506 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sat, 3 Aug 2024 14:43:24 +0800 Subject: [PATCH] Don't drop PackedScene as property --- editor/scene_tree_dock.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 2cb2120d110..56924fc1fe7 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -3331,9 +3331,10 @@ void SceneTreeDock::_files_dropped(const Vector &p_files, NodePath p_to, const String &res_path = p_files[0]; const StringName res_type = EditorFileSystem::get_singleton()->get_file_type(res_path); + const bool is_dropping_scene = ClassDB::is_parent_class(res_type, "PackedScene"); - // Dropping as property when possible. - if (p_type == 0 && p_files.size() == 1) { + // Dropping as property. + if (p_type == 0 && p_files.size() == 1 && !is_dropping_scene) { List valid_properties; List pinfo; @@ -3378,7 +3379,7 @@ void SceneTreeDock::_files_dropped(const Vector &p_files, NodePath p_to, // Either instantiate scenes or create AudioStreamPlayers. int to_pos = -1; _normalize_drop(node, to_pos, p_type); - if (ClassDB::is_parent_class(res_type, "PackedScene")) { + if (is_dropping_scene) { _perform_instantiate_scenes(p_files, node, to_pos); } else if (ClassDB::is_parent_class(res_type, "AudioStream")) { _perform_create_audio_stream_players(p_files, node, to_pos);