Skip to content

Fix relative external paths in binary resources - #123544

Open
shaobin1991 wants to merge 1 commit into
godotengine:masterfrom
shaobin1991:fix-binary-resource-relative-paths
Open

shaobin1991 wants to merge 1 commit into
godotengine:masterfrom
shaobin1991:fix-binary-resource-relative-paths

Conversation

@shaobin1991

Copy link
Copy Markdown
Contributor

What problem(s) does this PR solve?

Relative external paths were resolved against the dependency path instead of the loaded resource's directory.

Additional information

path is the dependency path. Using it as the base caused the bug:

path = ProjectSettings::get_singleton()->localize_path(path.get_base_dir().path_join(external_resources[i].path));

The relative path should be resolved from local_path instead.
This matches the relative-path resolution semantics used by the text resource loader:

path = ProjectSettings::get_singleton()->localize_path(local_path.get_base_dir().path_join(path));

Testing

Added a regression test for a binary resource with a cross-directory relative external dependency.

Passed the focused regression test and the [Resource]* test group locally.

@shaobin1991
shaobin1991 requested review from a team as code owners September 16, 2026 10:26
@AThousandShips AThousandShips added this to the 4.x milestone Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relative paths in binary resources resolve incorrectly

2 participants