godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.48k stars 21.26k forks source link

Can't drag and drop assign multiple Custom Resources in the editor the same way built-in resources can #92666

Open JustCozzie opened 6 months ago

JustCozzie commented 6 months ago

Tested versions

Reproducible in Godot v4.2.1.stable

System information

Godot v4.2.1.stable - Windows 10.0.22631 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3060 Laptop GPU (NVIDIA; 31.0.15.4630) - 12th Gen Intel(R) Core(TM) i7-12700H (20 Threads)

Issue description

image

When assigning Custom Resource files (verified .res and .tres) to the array of another Custom Resource class, files can only be drag-and-dropped from the FileSystem one at a time, unlike resources of built in types like Texture2D which can be assigned in bulk, extending the array as needed.

The Docs don't specify this functionality is intended to be limited to built in types:

If the exported array specifies a type which inherits from Resource, the array values can be set in the inspector by dragging and dropping multiple files from the FileSystem dock at once.

Ideally all resources would work the same way, as it would drastically increase the ease of working with Custom Resources.

Steps to reproduce

Custom Resource 1

extends Resource
class_name MoveBase

Custom Resource 2

extends Resource
class_name MonsterBase
@export var learnableMoves : Array[MoveBase] = []

Create multiple MoveBase files, and one MonsterBase file.

Shift-click to select multiple Movebase files in the FileSystem and click and drag them onto the empty learnableMoves array within a MonsterBase file. The cursor will change to a stop sign to show this is unallowed.

Changing/removing the type hinting in the learnableMoves allows you to successfully do the same with non-Custom Resource types.

Minimal reproduction project (MRP)

N/A

huwpascoe commented 5 months ago

I think this must be a bug, there's nothing in editor_properties_array_dict.cpp that seems to suggest limiting to just built in types

ydeltastar commented 5 months ago

Drag and dropping built-in resources don't work too if it's a @tool script unless I restart the editor after defining the export variable in v4.3.beta [8bf8f41fc017531b502fe77b36c3b14e180cec5c].

AThousandShips commented 5 months ago

That's likely a different bug, related to updating global classes, there's reports for it open, can't remember them specifically right now though

But the original bug still occurs on 4.3 and 4.2.2?

ydeltastar commented 5 months ago

It does in v4.3.beta.

greenfox1505 commented 3 weeks ago

This is confirmed and is blocking using typed arrays in Func-Godot

https://github.com/func-godot/func_godot_plugin/pull/57