Sujith:) 3235125f3b Sujith :) -> пре 1 дан
..
Documentation 449315d9da Sujith :) -> пре 2 дана
__pycache__ 48caadace0 Sujith :) -> пре 2 дана
config 3235125f3b Sujith :) -> пре 1 дан
orchestrators 3235125f3b Sujith :) -> пре 1 дан
parsers 3235125f3b Sujith :) -> пре 1 дан
utils e3fa853059 Sujith :) -> пре 2 дана
Documentation.meta eda9e41424 Sujith :) -> пре 2 дана
README.md 1aee008eeb Sujith :) -> пре 1 недеља
README.md.meta aa6c1eb3e1 Sujith :) -> пре 1 недеља
__pycache__.meta fbefeedc6d Sujith :) -> пре 3 дана
config.meta 48caadace0 Sujith :) -> пре 2 дана
orchestrators.meta 58d107df1e Sujith :) -> пре 2 дана
parsers.meta 2fbef7a443 Sujith :) -> пре 3 дана
utils.meta 1aee008eeb Sujith :) -> пре 1 недеља

README.md

Unity Project Data Extractor

This directory contains a suite of Python scripts designed to extract and process data from a Unity project in various levels of detail.

Core Scripts

There are three main executable scripts:

  1. extract_high_level.py: Generates a top-down summary of the project, including project settings, package manifests, and GUID-to-asset path mappings.
  2. extract_mid_level.py: Creates a virtual representation of the project's Assets directory. It converts scenes and prefabs into JSON files representing the GameObject hierarchy and copies all C# scripts.
  3. extract_low_level.py: Performs a deep-dive extraction, creating a detailed JSON file for every single GameObject in each scene and prefab.

How to Run

All scripts are designed to be run from the root directory of the Unity project. They require a Python virtual environment with ruamel.yaml installed.

Prerequisites

Activate the virtual environment:

source venv/bin/activate

Execution

Each script accepts two command-line arguments:

  • --input: The root directory of the Unity project (e.g., .).
  • --output: The directory where the generated output folder will be saved.

Example:

To run the high-level extractor and save the output to a folder named MyOutput:

python3 Assets/LLM/source/extract_high_level.py --input . --output ./MyOutput

To run the mid-level extractor:

python3 Assets/LLM/source/extract_mid_level.py --input . --output ./MyOutput

To run the low-level extractor:

python3 Assets/LLM/source/extract_low_level.py --input . --output ./MyOutput

Utility Modules

The core logic is contained in the utils/ subdirectory:

  • yaml_utils.py: Handles the complexities of parsing Unity's custom YAML format.
  • file_utils.py: Provides helper functions for file system operations like finding files.
  • virtual_tree_builder.py: Builds the nested GameObject hierarchy for the mid-level extractor.
  • deep_parser.py: Contains the logic for the deep, flat-list parsing used by the low-level extractor.
  • json_reducer.py: An unused utility for reducing the size of JSON objects.