2025-04-29 18:26:13 +02:00

34 lines
16 KiB
JSON

{
"sourceFile": "Documentation/02_Developer_Guide/01_Architecture.md",
"activeCommit": 0,
"commits": [
{
"activePatchIndex": 4,
"patches": [
{
"date": 1745494423952,
"content": "Index: \n===================================================================\n--- \n+++ \n"
},
{
"date": 1745933699117,
"content": "Index: \n===================================================================\n--- \n+++ \n@@ -11,18 +11,19 @@\n 3. **Multiple Interfaces:** Provides different ways to interact with the tool:\r\n * Graphical User Interface (GUI)\r\n * Command-Line Interface (CLI)\r\n * Directory Monitor for automated processing.\r\n+These interfaces now exchange significantly more detailed data structures containing information about each file and asset set being processed.\r\n 4. **Optional Integration:** Includes scripts and logic for integrating with external software, specifically Blender, to automate material and node group creation.\r\n \r\n ## Core Components\r\n \r\n * `config.py`: Defines core, global settings and constants.\r\n * `Presets/*.json`: Supplier-specific JSON files defining rules for file interpretation and processing.\r\n * `configuration.py` (`Configuration` class): Loads `config.py` settings and merges them with a selected preset, pre-compiling regex patterns for efficiency.\r\n-* `asset_processor.py` (`AssetProcessor` class): Contains the core logic for processing a *single* asset through the defined pipeline steps.\r\n-* `main.py`: The entry point for the CLI, handling argument parsing, logging, parallel processing orchestration, and triggering Blender scripts.\r\n-* `gui/`: Directory containing modules for the GUI, built with PySide6.\r\n+* `asset_processor.py` (`AssetProcessor` class): Contains the core logic for processing a *single* asset through the defined pipeline steps. This component now works with enhanced data structures.\r\n+* `main.py`: The entry point for the CLI, handling argument parsing, logging, parallel processing orchestration, and triggering Blender scripts. It exchanges enhanced data structures with the core processor and GUI.\r\n+* `gui/`: Directory containing modules for the GUI, built with PySide6. These modules handle and utilize the richer data structures received from the core processing engine.\r\n * `monitor.py`: Implements the directory monitoring feature using `watchdog`.\r\n * `blenderscripts/`: Contains Python scripts designed to be executed *within* Blender for post-processing tasks.\r\n \r\n ## Processing Pipeline (Simplified)\r\n@@ -39,5 +40,5 @@\n 8. Organization of processed files into the final output structure.\r\n 9. Cleanup of the temporary workspace.\r\n 10. (Optional) Execution of Blender scripts for post-processing.\r\n \r\n-This architecture allows for a modular design, separating configuration, core processing logic, and different interfaces. Parallel processing is utilized for efficiency, and background threads keep the GUI responsive.\n\\ No newline at end of file\n+This architecture allows for a modular design, separating configuration, core processing logic, and different interfaces. The data structures flowing through this pipeline now carry significantly more detailed information about individual files and asset sets. Parallel processing is utilized for efficiency, and background threads keep the GUI responsive.\n\\ No newline at end of file\n"
},
{
"date": 1745933964077,
"content": "Index: \n===================================================================\n--- \n+++ \n@@ -11,19 +11,19 @@\n 3. **Multiple Interfaces:** Provides different ways to interact with the tool:\r\n * Graphical User Interface (GUI)\r\n * Command-Line Interface (CLI)\r\n * Directory Monitor for automated processing.\r\n-These interfaces now exchange significantly more detailed data structures containing information about each file and asset set being processed.\r\n+These interfaces exchange data structures containing information about each file and asset set being processed.\r\n 4. **Optional Integration:** Includes scripts and logic for integrating with external software, specifically Blender, to automate material and node group creation.\r\n \r\n ## Core Components\r\n \r\n * `config.py`: Defines core, global settings and constants.\r\n * `Presets/*.json`: Supplier-specific JSON files defining rules for file interpretation and processing.\r\n * `configuration.py` (`Configuration` class): Loads `config.py` settings and merges them with a selected preset, pre-compiling regex patterns for efficiency.\r\n-* `asset_processor.py` (`AssetProcessor` class): Contains the core logic for processing a *single* asset through the defined pipeline steps. This component now works with enhanced data structures.\r\n-* `main.py`: The entry point for the CLI, handling argument parsing, logging, parallel processing orchestration, and triggering Blender scripts. It exchanges enhanced data structures with the core processor and GUI.\r\n-* `gui/`: Directory containing modules for the GUI, built with PySide6. These modules handle and utilize the richer data structures received from the core processing engine.\r\n+* `asset_processor.py` (`AssetProcessor` class): Contains the core logic for processing a *single* asset through the defined pipeline steps. This component works with data structures containing detailed information about the asset and its files.\r\n+* `main.py`: The entry point for the CLI, handling argument parsing, logging, parallel processing orchestration, and triggering Blender scripts. It exchanges data structures with the core processor and GUI.\r\n+* `gui/`: Directory containing modules for the GUI, built with PySide6. These modules handle and utilize the data structures received from the core processing engine.\r\n * `monitor.py`: Implements the directory monitoring feature using `watchdog`.\r\n * `blenderscripts/`: Contains Python scripts designed to be executed *within* Blender for post-processing tasks.\r\n \r\n ## Processing Pipeline (Simplified)\r\n@@ -40,5 +40,5 @@\n 8. Organization of processed files into the final output structure.\r\n 9. Cleanup of the temporary workspace.\r\n 10. (Optional) Execution of Blender scripts for post-processing.\r\n \r\n-This architecture allows for a modular design, separating configuration, core processing logic, and different interfaces. The data structures flowing through this pipeline now carry significantly more detailed information about individual files and asset sets. Parallel processing is utilized for efficiency, and background threads keep the GUI responsive.\n\\ No newline at end of file\n+This architecture allows for a modular design, separating configuration, core processing logic, and different interfaces. The data structures flowing through this pipeline carry detailed information about individual files and asset sets. Parallel processing is utilized for efficiency, and background threads keep the GUI responsive.\n\\ No newline at end of file\n"
},
{
"date": 1745934361165,
"content": "Index: \n===================================================================\n--- \n+++ \n@@ -20,9 +20,9 @@\n * `config.py`: Defines core, global settings and constants.\r\n * `Presets/*.json`: Supplier-specific JSON files defining rules for file interpretation and processing.\r\n * `configuration.py` (`Configuration` class): Loads `config.py` settings and merges them with a selected preset, pre-compiling regex patterns for efficiency.\r\n * `asset_processor.py` (`AssetProcessor` class): Contains the core logic for processing a *single* asset through the defined pipeline steps. This component works with data structures containing detailed information about the asset and its files.\r\n-* `main.py`: The entry point for the CLI, handling argument parsing, logging, parallel processing orchestration, and triggering Blender scripts. It exchanges data structures with the core processor and GUI.\r\n+* `main.py`: The entry point for the Command-Line Interface (CLI). It handles argument parsing, logging, parallel processing orchestration, and triggering Blender scripts. It orchestrates the processing of multiple assets by interacting with the `AssetProcessor` for individual assets and manages the overall CLI execution flow.\r\n * `gui/`: Directory containing modules for the GUI, built with PySide6. These modules handle and utilize the data structures received from the core processing engine.\r\n * `monitor.py`: Implements the directory monitoring feature using `watchdog`.\r\n * `blenderscripts/`: Contains Python scripts designed to be executed *within* Blender for post-processing tasks.\r\n \r\n@@ -40,5 +40,7 @@\n 8. Organization of processed files into the final output structure.\r\n 9. Cleanup of the temporary workspace.\r\n 10. (Optional) Execution of Blender scripts for post-processing.\r\n \r\n-This architecture allows for a modular design, separating configuration, core processing logic, and different interfaces. The data structures flowing through this pipeline carry detailed information about individual files and asset sets. Parallel processing is utilized for efficiency, and background threads keep the GUI responsive.\n\\ No newline at end of file\n+This architecture allows for a modular design, separating configuration, core processing logic, and different interfaces. The data structures flowing through this pipeline carry detailed information about individual files and asset sets. Examples include lists of input file paths, configuration objects, dictionaries summarizing processing outcomes, and detailed lists of file predictions. Parallel processing is utilized for efficiency, and background threads keep the GUI responsive.\r\n+\r\n+**Note on Data Passing:** Major changes to the data passing mechanisms between the GUI, Main (CLI orchestration), and `AssetProcessor` modules are currently being planned. These changes are expected to involve new data structures and updated interaction patterns to convey detailed specifications for datasets/asset-sets and processing instructions for individual files. The documentation in this section, particularly regarding data flow, will require significant review and updates once the plan for these changes is finalized.\n\\ No newline at end of file\n"
},
{
"date": 1745934375142,
"content": "Index: \n===================================================================\n--- \n+++ \n@@ -21,9 +21,9 @@\n * `Presets/*.json`: Supplier-specific JSON files defining rules for file interpretation and processing.\r\n * `configuration.py` (`Configuration` class): Loads `config.py` settings and merges them with a selected preset, pre-compiling regex patterns for efficiency.\r\n * `asset_processor.py` (`AssetProcessor` class): Contains the core logic for processing a *single* asset through the defined pipeline steps. This component works with data structures containing detailed information about the asset and its files.\r\n * `main.py`: The entry point for the Command-Line Interface (CLI). It handles argument parsing, logging, parallel processing orchestration, and triggering Blender scripts. It orchestrates the processing of multiple assets by interacting with the `AssetProcessor` for individual assets and manages the overall CLI execution flow.\r\n-* `gui/`: Directory containing modules for the GUI, built with PySide6. These modules handle and utilize the data structures received from the core processing engine.\r\n+* `gui/`: Directory containing modules for the Graphical User Interface (GUI), built with PySide6. The GUI interacts with the core processing logic indirectly via dedicated handler classes (`ProcessingHandler`, `PredictionHandler`) running in separate threads. Data structures, such as input paths, configuration details, processing progress updates, and file prediction results, are passed between the GUI, these handlers, and the `AssetProcessor` using thread-safe mechanisms like Qt signals and slots.\r\n * `monitor.py`: Implements the directory monitoring feature using `watchdog`.\r\n * `blenderscripts/`: Contains Python scripts designed to be executed *within* Blender for post-processing tasks.\r\n \r\n ## Processing Pipeline (Simplified)\r\n"
}
],
"date": 1745494423952,
"name": "Commit-0",
"content": "# Developer Guide: Architecture\r\n\r\nThis document provides a high-level overview of the Asset Processor Tool's architecture and core components for developers.\r\n\r\n## High-Level Architecture\r\n\r\nThe Asset Processor Tool is designed to process 3D asset source files into a standardized library format. Its high-level architecture consists of:\r\n\r\n1. **Core Processing Engine (`AssetProcessor`):** The central component responsible for orchestrating the asset processing pipeline for a single input asset.\r\n2. **Configuration System (`Configuration`):** Handles loading core settings and merging them with supplier-specific rules defined in JSON presets.\r\n3. **Multiple Interfaces:** Provides different ways to interact with the tool:\r\n * Graphical User Interface (GUI)\r\n * Command-Line Interface (CLI)\r\n * Directory Monitor for automated processing.\r\n4. **Optional Integration:** Includes scripts and logic for integrating with external software, specifically Blender, to automate material and node group creation.\r\n\r\n## Core Components\r\n\r\n* `config.py`: Defines core, global settings and constants.\r\n* `Presets/*.json`: Supplier-specific JSON files defining rules for file interpretation and processing.\r\n* `configuration.py` (`Configuration` class): Loads `config.py` settings and merges them with a selected preset, pre-compiling regex patterns for efficiency.\r\n* `asset_processor.py` (`AssetProcessor` class): Contains the core logic for processing a *single* asset through the defined pipeline steps.\r\n* `main.py`: The entry point for the CLI, handling argument parsing, logging, parallel processing orchestration, and triggering Blender scripts.\r\n* `gui/`: Directory containing modules for the GUI, built with PySide6.\r\n* `monitor.py`: Implements the directory monitoring feature using `watchdog`.\r\n* `blenderscripts/`: Contains Python scripts designed to be executed *within* Blender for post-processing tasks.\r\n\r\n## Processing Pipeline (Simplified)\r\n\r\nThe core processing engine (`AssetProcessor`) executes a series of steps for each asset:\r\n\r\n1. Extraction of input to a temporary workspace.\r\n2. Classification of files (map, model, extra, ignored, unrecognised) using preset rules.\r\n3. Determination of base metadata (asset name, category, archetype).\r\n4. Skip check if output exists and overwrite is not forced.\r\n5. Processing of maps (resize, format/bit depth conversion, inversion, stats calculation).\r\n6. Merging of channels based on rules.\r\n7. Generation of `metadata.json` file.\r\n8. Organization of processed files into the final output structure.\r\n9. Cleanup of the temporary workspace.\r\n10. (Optional) Execution of Blender scripts for post-processing.\r\n\r\nThis architecture allows for a modular design, separating configuration, core processing logic, and different interfaces. Parallel processing is utilized for efficiency, and background threads keep the GUI responsive."
}
]
}