5.9 KiB
5.9 KiB
Developer Guide: Codebase Structure
This document outlines the key files and directories within the Asset Processor Tool project.
Asset_processor_tool/
├── asset_processor.py # Core class handling single asset processing pipeline
├── config.py # Core settings definition (output paths, resolutions, merge rules etc.)
├── configuration.py # Class for loading and accessing configuration (merges config.py and presets)
├── detailed_documentation_plan.md # (Existing file, potentially outdated)
├── Dockerfile # Instructions for building the Docker container image
├── documentation_plan.md # Plan for the new documentation structure (this plan)
├── documentation.txt # Original developer documentation (to be migrated)
├── main.py # CLI Entry Point & processing orchestrator
├── monitor.py # Directory monitoring script for automated processing
├── readme.md # Original main documentation file (to be migrated)
├── readme.md.bak # Backup of readme.md
├── requirements-docker.txt # Dependencies specifically for the Docker environment
├── requirements.txt # Python package dependencies for standard execution
├── blenderscripts/ # Scripts for integration with Blender
│ ├── create_materials.py # Script to create materials linking to node groups
│ └── create_nodegroups.py # Script to create node groups from processed assets
├── Deprecated-POC/ # Directory containing original proof of concept scripts
│ ├── Blender-MaterialsFromNodegroups.py
│ ├── Blender-NodegroupsFromPBRSETS.py
│ └── Standalonebatcher-Main.py
├── Documentation/ # New directory for organized documentation (this structure)
│ ├── 00_Overview.md
│ ├── 01_User_Guide/
│ └── 02_Developer_Guide/
├── gui/ # Contains files related to the Graphical User Interface
│ ├── main_window.py # Main GUI application window and layout
│ ├── processing_handler.py # Handles background processing logic for the GUI
│ ├── prediction_handler.py # Handles background file prediction/preview for the GUI
│ ├── preview_table_model.py # Model and proxy for the GUI's preview table
│ └── ... # Other GUI components
├── Presets/ # Preset definition files
│ ├── _template.json # Template for creating new presets
│ ├── Poliigon.json # Example preset for Poliigon assets
│ └── ... # Other presets
├── Project Notes/ # Directory for issue and feature tracking (Markdown files)
│ ├── ... # Various planning and note files
└── Testfiles/ # Directory containing example input assets for testing
└── ... # Example asset ZIPs
Key Files and Directories:
asset_processor.py: Contains theAssetProcessorclass, the core logic for processing a single asset through the pipeline. Includes methods for classification, map processing, merging, metadata generation, and output organization. Also provides methods for predicting output structure used by the GUI.configuration.py: Defines theConfigurationclass. Responsible for loading core settings fromconfig.pyand merging them with a specified preset JSON file (Presets/*.json). Pre-compiles regex patterns from presets for efficiency.config.py: Stores global default settings, constants, and core rules (e.g., standard map types, default resolutions, merge rules, output format rules, Blender paths).main.py: Entry point for the Command-Line Interface (CLI). Handles argument parsing, logging setup, parallel processing orchestration (usingconcurrent.futures.ProcessPoolExecutor), callsAssetProcessorvia a wrapper function, and optionally triggers Blender scripts.monitor.py: Implements the automated directory monitoring feature using thewatchdoglibrary. Contains theZipHandlerclass to detect new ZIP files and trigger processing viamain.run_processing.gui/: Directory containing all code related to the Graphical User Interface (GUI), built with PySide6.main_window.py: Defines theMainWindowclass, the main application window structure, UI layout, event handling, and menu setup. Manages GUI-specific logging (QtLogHandler).processing_handler.py: Defines theProcessingHandlerclass (runs on aQThread). Manages the execution of the main asset processing pipeline and Blender script execution in the background.prediction_handler.py: Defines thePredictionHandlerclass (runs on aQThread). Manages background file analysis/preview generation.preview_table_model.py: DefinesPreviewTableModelandPreviewSortFilterProxyModelfor managing and displaying data in the GUI's preview table.
blenderscripts/: Contains Python scripts (create_nodegroups.py,create_materials.py) designed to be executed within Blender for post-processing.Presets/: Contains supplier-specific configuration files in JSON format.Testfiles/: Contains example input assets for testing purposes.Tickets/: Directory for issue and feature tracking using Markdown files.
Note on Data Passing: As mentioned in the Architecture documentation, major changes to the data passing mechanisms between the GUI, Main (CLI orchestration), and asset_processor modules are currently being planned. The descriptions of module interactions and data flow within this document reflect the current state and will require review and updates once the plan for these changes is finalized.