Skip to content

Commit

Permalink
Merge pull request #95090 from timothyqiu/scene-drop
Browse files Browse the repository at this point in the history
Don't drop `PackedScene` as property
  • Loading branch information
akien-mga committed Aug 6, 2024
2 parents 20eee3e + 8b3400e commit ee986b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions editor/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3331,9 +3331,10 @@ void SceneTreeDock::_files_dropped(const Vector<String> &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<String> valid_properties;

List<PropertyInfo> pinfo;
Expand Down Expand Up @@ -3378,7 +3379,7 @@ void SceneTreeDock::_files_dropped(const Vector<String> &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);
Expand Down

0 comments on commit ee986b7

Please sign in to comment.