Turn a Unity project into a trimmed, dated reference snapshot for migration work, especially Unity-to-Godot rebuilds.
The export is not a runnable Unity project. It is a compact reference pack with
source scripts, authored assets, prefab/scene YAML, selected project settings,
Unity .meta GUIDs, and generated notes for humans and AI agents.
Copy this repository into a Unity project root. It can be a Git submodule:
git submodule add https://github.com/PolyDart/UnityExportTool.git toolspython3 tools/export_godot_reference.pyBy default the export goes under GodotReferenceExports/godot-reference-YYYYmmdd/.
If that folder already exists, the script uses -2, -3, and so on instead of
adding a timestamp.
For a new Unity project, generate a local JSON config first:
python3 tools/export_godot_reference.py --init-configThen have a developer or AI agent edit godot_reference_config.local.json.
Use a dry run before writing the export:
python3 tools/export_godot_reference.py --config godot_reference_config.local.json --dry-run
python3 tools/export_godot_reference.py --config godot_reference_config.local.jsonThe generated config includes tuning notes and a suggested workflow. Prefer making project-specific changes there instead of editing the Python defaults.
--dry-run: prints the files that would be exported without creating a folder.--zip: creates a.ziparchive next to the export folder.--name NAME: uses a specific export folder name instead of the default dated name.--output-root DIR: writes exports under a different root folder.--project-root DIR: Unity project root to export from. Default is the current working directory.--config FILE: loads a JSON config with export policy overrides.--init-config [FILE]: writes a tunable JSON config template and exits. If no file is supplied, writesgodot_reference_config.local.json.--force: overwrites an existing file when used with--init-config.--print-policy: prints the active merged policy as JSON and exits.--include-vendors: includes bulky/vendor Unity folders that are normally skipped, such as Photon, TextMesh Pro, plugins, and render-pipeline settings.--no-meta: skips Unity.metafiles. This makes the export cleaner, but loses GUID traceability for prefab/scene references.
Config files can override:
output_rootinclude_pathsexclude_patternsvendor_paths_excluded_by_defaultexport_noteai_context_template
The ai_context_template can use {source_project}.
Example:
python3 tools/export_godot_reference.py --config tools/godot_reference_config.example.json --dry-runEach export includes:
EXPORT_NOTE.md: human-readable date, source commit, and purposeAI_CONTEXT.md: migration context for future AI agents and developersexport_manifest.json: exact file list, sizes, hashes, include rules, and source Git state
Default include/exclude rules and generated markdown live in
godot_reference_config.py. The defaults are conservative and cloneable across
Unity projects, but no generic exporter can perfectly know a project’s useful
assets. Always inspect --dry-run output before treating an export as complete.