-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
Renaming custom resources breaks scenes that have exported Array[CustomResource] #92068
Comments
Can you please try dev6 |
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")]) New scenes/resources (created or saved after the fix) update paths correctly. Old scenes/resources still do not handle such renaming, so they must be saved at least once in the new version of the engine.
I'm not sure about this. An input from editor contributors would be appreciated. |
I was using 4.3.dev5 so it wasn't working, even after saving the files.
You are totally right. It seems this is fixed on 4.3.dev6. |
Closing this, fixed in 4.3.dev6. On a totally unrelated note. |
|
Tested versions
System information
Windows 10 - Vulkan (forward+) - dedicated
Issue description
Renaming a folder that have a custom resource may break scenes that have
@export
vars using Array[CustomResource]The renaming works if the
@export
type is the CustomResource type itself.But it seems the renaming does not take into account values inside Arrays
Steps to reproduce
Steps:
@export var data_array Array[CustomResource
Results: Crashes scene ('Error while parsing the file'). Can't re-open.
The resources inside the Array are not updated after renaming the folder. So the parser fails with FileNotFound.
Expected: Files path properly updated.
Here's the data that was not updated:
Something similar also happens if you use sub-resources, creating the resource from the inspector.
But in 4.3-dev5. It won't break the scene.
And it'll only spits the error when you select the node that has that export variable.
You can revert it by changing the folder name back. Or by opening the scene file as a text and updating the paths manually.
Minimal reproduction project (MRP)
Minimal reproduction project:
bugs_rename_resource.zip
The text was updated successfully, but these errors were encountered: