Skip to content
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

uid:// Paths Fail to Load at Editor Startup #95562

Closed
mpewsey opened this issue Aug 15, 2024 · 2 comments · Fixed by #95689
Closed

uid:// Paths Fail to Load at Editor Startup #95562

mpewsey opened this issue Aug 15, 2024 · 2 comments · Fixed by #95689

Comments

@mpewsey
Copy link

mpewsey commented Aug 15, 2024

Tested versions

  • Reproducible in v4.3.stable.mono.official [77dcf97]
  • Not reproducible in v4.2.2.stable.mono.official [15073af]

System information

Windows 11 v4.3.stable.mono.official [77dcf97]

Issue description

In Godot 4.3.0, when opening a project that loads a resource by a uid:// path at startup, the resource fails to load.

The attached MRP uses the following plugin script to load a resource at startup:

@tool
extends EditorPlugin


func _enter_tree():
	var uidPath = "uid://dr1hds7vve78t";
	var resPath = "res://resource.tres";
	var uidResource = ResourceLoader.load(uidPath);
	
	if uidResource == null:
		printerr("Resource is null, meaning it couldn't be loaded by uid:// path.")
	else:
		print("Resource could be loaded by uid:// path.")

	var resResource = ResourceLoader.load(resPath);

	if resResource == null:
		printerr("Resource is null, meaning it couldn't be loaded by res:// path.")
	else:
		print("Resource could be loaded by res:// path.")

With this, I get the following errors at startup:

Godot Engine v4.3.stable.mono.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
--- Debug adapter server started on port 6006 ---
--- GDScript language server started on port 6005 ---
  core/io/resource_uid.cpp:132 - Condition "!unique_ids.has(p_id)" is true. Returning: String()
  Resource file not found:  (expected type: )
  Error loading resource: 'uid://dr1hds7vve78t'.
  Resource is null, meaning it couldn't be loaded by uid:// path.
Resource could be loaded by res:// path.

This issue does not occur with the MRP using v4.2.2.stable.mono.official [15073af], so there seems to be a regression between 4.2.2 and 4.3.0.

I believe the issue in #95535 may be related.

Once the editor has fully started up, if you toggle the plugin to invoke the _enter_tree method again, Godot is able to successfully load the resource by uid:// at that point.

Steps to reproduce

  • Open the MRP in Godot 4.3.0.
  • The error should appear in the log. If it doesn't, enable the GdDummy plugin from the Project > Project Settings > Plugins tab.

Minimal reproduction project (MRP)

GodotUidBug-main.zip

@mpewsey mpewsey changed the title uid:// Paths Not Available at Editor Startup uid:// Paths Fail to Load at Editor Startup Aug 15, 2024
@matheusmdx
Copy link
Contributor

Bisecting points to #92303 as the culprit:

image

@akien-mga
Copy link
Member

CC @Hilderin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Very Bad
Development

Successfully merging a pull request may close this issue.

4 participants