From da5f7c6b4065ab8246d6ba839c01a5267f9445a6 Mon Sep 17 00:00:00 2001 From: jsjtxietian Date: Fri, 26 Jul 2024 11:48:51 +0800 Subject: [PATCH] Add support for dragging a shader to user exported material property --- editor/editor_resource_picker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index 4cd44e30200..8935b9ad8ad 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -618,9 +618,9 @@ void EditorResourcePicker::_ensure_allowed_types() const { const String base = allowed_types[i].strip_edges(); if (base == "BaseMaterial3D") { allowed_types_with_convert.insert("Texture2D"); - } else if (base == "ShaderMaterial") { + } else if (ClassDB::is_parent_class("ShaderMaterial", base)) { allowed_types_with_convert.insert("Shader"); - } else if (base == "Texture2D") { + } else if (ClassDB::is_parent_class("ImageTexture", base)) { allowed_types_with_convert.insert("Image"); } }