1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Improve drag and drop by supporting more file types & node types

Adds support for dragging in all files of type Texture2D for 2D.
Adds support for dragging in all files of type Mesh for 3D.
Replaces adding texture as Light2D with PointLight2D.
Add more node types that textures can be added as
- TextureButton
- CPUParticles2D
This commit is contained in:
foxydevloper
2021-07-29 02:46:38 -04:00
parent ac1dab5062
commit e62ad6ad80
3 changed files with 64 additions and 62 deletions

View File

@@ -4030,7 +4030,7 @@ bool Node3DEditorViewport::can_drop_data_fw(const Point2 &p_point, const Variant
continue;
}
memdelete(instantiated_scene);
} else if (type == "Mesh" || type == "ArrayMesh" || type == "PrimitiveMesh") {
} else if (ClassDB::is_parent_class(type, "Mesh")) {
Ref<Mesh> mesh = ResourceLoader::load(files[i]);
if (!mesh.is_valid()) {
continue;