You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like there might be a regression with either custom resources or EditorImportPlugin.
In versions previous to 4.4dev2 I used a EditorImportPlugin to load an array of Task custom resources as a TaskList resource from a CSV file. In 4.4dev2 and 4.4dev3 loading the CSV from game code seems to return an empty array instead. No errors are produced. Interestingly enough, in affected versions the imported data can be viewed in the editor. Also loading the resource from a @tool script seems to work.
Instead of an array of custom resources, I also tried to load an array of String, which made no difference.
Steps to reproduce
Create resource to hold an array of data (another custom resource in my case).
Create an EditorImportPlugin which reads a CSV and saves it as the aforementioned container resource
Create custom CSV data and let Godot import that via the EditorImportPlugin
Observe that the resource can be explored in the editor, meaning that it has been successfully imported
Add code to load or preload the CSV data during runtime
I tried out the MRP and the _import is being called properly, and the resource is being created correctly (you can confirm by looking in .godot/import.
The issue seems to be related to typing when loading the resource.
This example has a parent class TaskList which has exported an array of Task objects, declared like this:
@export var data: Array[Task] = []
If you remove the Task type for the array, say @export var data: Array = [] it correctly prints the values at runtime, even using the Task class's _to_string
No re-import is required. This implies to me that perhaps the Task class/type is not found or loaded when Godot is loading the resource, so it leaves the array empty.
One strange thing is I tried putting another @export var t: Task as a test into the resource and it worked fine, so this issue seems to be specific to loading a resource with a typed array of other resources.
Tested versions
System information
Godot v4.4.dev3 - Ubuntu 22.04.5 LTS 22.04 on X11 - X11 display driver, Single-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 (nvidia; 535.183.01) - AMD Ryzen 5 3600 6-Core Processor (12 threads)
Issue description
It seems like there might be a regression with either custom resources or
EditorImportPlugin
.In versions previous to 4.4dev2 I used a
EditorImportPlugin
to load an array ofTask
custom resources as aTaskList
resource from a CSV file. In 4.4dev2 and 4.4dev3 loading the CSV from game code seems to return an empty array instead. No errors are produced. Interestingly enough, in affected versions the imported data can be viewed in the editor. Also loading the resource from a@tool
script seems to work.Instead of an array of custom resources, I also tried to load an array of
String
, which made no difference.Steps to reproduce
load
orpreload
the CSV data during runtimeMinimal reproduction project (MRP)
csvimport.zip
The text was updated successfully, but these errors were encountered: