-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array of custom Resources with class_name
is saved using its path and breaks if the script is moved
#90963
Labels
Comments
Might be related to recent typed array marshalling changes, cc @dalexeev. |
However, you need to save the resource once so that the script path is saved as Before save: [gd_resource type="Resource" script_class="ResourceContainer" load_steps=3 format=3 uid="uid://bj4r1yoqqhakg"]
[ext_resource type="Script" path="res://ResourceContainer.gd" id="1_1u0yv"]
[ext_resource type="Resource" uid="uid://ogkvdrpc07li" path="res://Contained1.tres" id="1_pvmiw"]
[resource]
script = ExtResource("1_1u0yv")
resources = Array[Resource("res://ContainedResource.gd")]([ExtResource("1_pvmiw")]) After save: [gd_resource type="Resource" script_class="ResourceContainer" load_steps=4 format=4 uid="uid://bj4r1yoqqhakg"]
[ext_resource type="Script" path="res://ResourceContainer.gd" id="1_1u0yv"]
[ext_resource type="Script" path="res://ContainedResource.gd" id="1_8b4xi"]
[ext_resource type="Resource" uid="uid://ogkvdrpc07li" path="res://Contained1.tres" id="1_pvmiw"]
[resource]
script = ExtResource("1_1u0yv")
resources = Array[ExtResource("1_8b4xi")]([ExtResource("1_pvmiw")]) |
I forgot to test on master, indeed the bug is fixed. |
Is there a workaround for this problem in the meantime? |
The issue is resolved in 4.3 beta. |
I'm running 4.3 beta2 and still have this issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested versions
4.3 dev 5 and probably earlier, idk if it's a regression
System information
Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 31.0.15.4633) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)
Issue description
When you have a custom resource with
class_name
and export an array of that resource, the array will be serialized asArray[Resource("res://path/to/script.gd")]
, completely ignoringclass_name
. When you move the script, the referenced path is not updated and the resource with array can't be loaded anymore.If script has
class_name
, the array should use class name.If it doesn't, it should use UID instead (once we have them in scripts).
Steps to reproduce
Resources.tres
ContainedResource.gd
to FolderResources.tres
no longer opensMinimal reproduction project (MRP)
bugpath.zip
The text was updated successfully, but these errors were encountered: