Skip to content

PolyDart/UnityExportTool

Repository files navigation

Unity Export Tool

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.

Install

Copy this repository into a Unity project root. It can be a Git submodule:

git submodule add https://github.com/PolyDart/UnityExportTool.git tools

Quick Start

python3 tools/export_godot_reference.py

By 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.

AI-Tunable Workflow

For a new Unity project, generate a local JSON config first:

python3 tools/export_godot_reference.py --init-config

Then 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.json

The generated config includes tuning notes and a suggested workflow. Prefer making project-specific changes there instead of editing the Python defaults.

Options

  • --dry-run: prints the files that would be exported without creating a folder.
  • --zip: creates a .zip archive 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, writes godot_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 .meta files. This makes the export cleaner, but loses GUID traceability for prefab/scene references.

Config Fields

Config files can override:

  • output_root
  • include_paths
  • exclude_patterns
  • vendor_paths_excluded_by_default
  • export_note
  • ai_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-run

Export Contents

Each export includes:

  • EXPORT_NOTE.md: human-readable date, source commit, and purpose
  • AI_CONTEXT.md: migration context for future AI agents and developers
  • export_manifest.json: exact file list, sizes, hashes, include rules, and source Git state

Notes

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages