Skip to content

Fix GUE media imports from absolute paths#64

Draft
CoreyRDean wants to merge 2 commits into
developfrom
fix/gue-media-import-paths
Draft

Fix GUE media imports from absolute paths#64
CoreyRDean wants to merge 2 commits into
developfrom
fix/gue-media-import-paths

Conversation

@CoreyRDean
Copy link
Copy Markdown
Collaborator

Non-technical summary

This fixes a reliability bug in the GUE media import flow. Adding meshes, textures, sounds, or music now correctly recognizes files that are already inside the current project's Data/... tree even when the file dialog returns an absolute path, and it still copies truly external selections into the chosen media folder.

This matters now because the existing code was slicing paths with hardcoded Data\\... offsets, which could mis-handle absolute selections and produce the wrong imported filename. After this change, project-local picks resolve to the expected relative media path instead of being treated like arbitrary external files.

Technical summary

  • added src/Modules/MediaImport.bb to centralize slash normalization, absolute-vs-relative detection, project-root matching, and relative media-path extraction
  • added src/Tests/Modules/MediaImportTest.bb to pin behavior for project-relative selections, absolute project-local selections, external absolute paths, and external folder imports
  • updated src/GUE.bb so mesh, texture, sound, and music imports all use the shared helper instead of duplicated string slicing
  • preserved the existing external-copy behavior while fixing the path-resolution boundary that decides whether a selection is already inside Data\\Meshes, Data\\Textures, Data\\Sounds, or Data\\Music
  • no breaking changes intended

Validation

  • git diff --check
  • attempted ./compiler/BlitzForge/compile.sh, but the pinned BlitzForge submodule failed on this macOS host before producing compiler/BlitzForge/bin/blitzcc (windows.h / _declspec / std::clog build errors in the dependency)
  • because blitzcc was not produced, ./test.sh could not be run in this environment

Additional notes

Trade-off: I kept the fix scoped to the GUE media-add flow instead of widening it into a repo-wide path-policy refactor.

Deferred follow-up: once the pinned BlitzForge macOS build is healthy again, the new Blitz test should be compiled as part of the normal ./test.sh sweep to convert this from static proof plus targeted test coverage into compiler-backed validation.

Remaining gap: this change does not alter runtime media loading or Project Manager publishing behavior; it only fixes the import-path boundary in GUE.

Pin the path extraction and copy-decision rules for GUE media imports so later fixes can preserve the intended behavior for project-local and external selections.
Route mesh, texture, sound, and music imports through the shared media-import helper so project-local selections are recognized correctly and external absolute paths still copy into the chosen media folder.
@CoreyRDean CoreyRDean added the bug Something isn't working label May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant