RepairScene 1.0 Scripts 4.0 Community
Submitted by user [email protected]; MIT; 2026-03-02
Repairs broken resource paths in Godot 4.x scene files after renaming or moving assets.
You renamed a folder. Now half your scenes show "Scene file appears to be invalid/corrupt" and Godot refuses to open them. The .tscn files contain hard-coded resource paths that no longer exist on disk. Fixing them manually means opening each file in a text editor and rewriting every broken ext_resource path by hand.
This EditorScript scans your .tscn files as raw text — bypassing Godot's resource loader entirely, because the whole point is to fix files Godot cannot open — finds every broken path= reference, and resolves it by matching the filename stem against your current project filesystem. Stale uid= tokens are stripped and regenerated on the next import.
Always run with write_changes set to false first. The dry-run mode logs every change it would make without touching any file.
Features:
- Scans entire project or a specific subfolder
- Resolves broken paths by filename stem match — handles moved files with the same name
- Strips stale uid= tokens so Godot regenerates them cleanly
- Backup system creates .bak files before overwriting anything
- Dry-run mode: logs all proposed changes without writing to disk
- Summary table: files scanned, refs broken, refs resolved, refs unresolved
- Configurable backup directory and backup-skip logic
- Zero dependencies — works in a blank project
Create a new script with EditorScript as the base class. Paste RepairScene.gd contents. Set scan_root. Run with Ctrl+Shift+X. Review the Output panel. Set write_changes to true to apply.
Godot 4.x only. GDScript 2.0.
Extended version with fuzzy path resolution for renamed files and closest-directory disambiguation available at nullstateassets.itch.io.
View files Download Submit an issue Recent Edits