{
    "sourceFile": "Documentation/02_Developer_Guide/09_Development_Workflow.md",
    "activeCommit": 0,
    "commits": [
        {
            "activePatchIndex": 0,
            "patches": [
                {
                    "date": 1745494882680,
                    "content": "Index: \n===================================================================\n--- \n+++ \n"
                }
            ],
            "date": 1745494882680,
            "name": "Commit-0",
            "content": "# Developer Guide: Development Workflow\r\n\r\nThis document provides guidance for developers on the typical workflow for contributing to or modifying the Asset Processor Tool.\r\n\r\n## Modifying Core Processing Logic\r\n\r\nChanges to how assets are classified, maps are processed (resizing, format conversion, bit depth handling), channels are merged, or metadata is generated primarily involve editing the `AssetProcessor` class in `asset_processor.py`. Understanding the processing pipeline steps outlined in `05_Processing_Pipeline.md` is crucial here.\r\n\r\n## Changing Global Settings/Rules\r\n\r\nAdjustments to default output paths, standard image resolutions, default format rules, map merge definitions, Blender paths, or other global constants should be made in `config.py`.\r\n\r\n## Adding/Modifying Supplier Rules (Presets)\r\n\r\nTo add support for a new asset source or change how an existing one is interpreted, you need to create or edit the corresponding JSON file in the `Presets/` directory.\r\n\r\n*   Use `Presets/_template.json` as a base for new presets.\r\n*   Focus on defining accurate regex patterns and rules in fields like `map_type_mapping`, `bit_depth_variants`, `model_patterns`, `source_naming_convention`, etc.\r\n*   Refer to `04_Configuration_System_and_Presets.md` for a detailed explanation of the preset file structure and the configuration loading process.\r\n\r\n## Adjusting CLI Behavior\r\n\r\nChanges to command-line arguments, argument parsing logic, or the overall CLI workflow are handled in `main.py`. This includes how arguments are parsed using `argparse`, how parallel processing is orchestrated, and how Blender scripts are triggered from the CLI.\r\n\r\n## Modifying the GUI\r\n\r\nWork on the Graphical User Interface involves the files within the `gui/` directory.\r\n\r\n*   UI layout changes, adding new controls, or altering event handling are typically done in `main_window.py`.\r\n*   Modifications to how background processing tasks are managed for the GUI are handled in `processing_handler.py`.\r\n*   Changes to how file classification previews are generated and updated in the UI are in `prediction_handler.py`.\r\n*   Understanding Qt's signals and slots mechanism and the use of `QThread` and `ProcessPoolExecutor` (as detailed in `06_GUI_Internals.md`) is essential for GUI development.\r\n\r\n## Enhancing Blender Integration\r\n\r\nImprovements or changes to how node groups or materials are created in Blender require editing the Python scripts within the `blenderscripts/` directory (`create_nodegroups.py`, `create_materials.py`).\r\n\r\n*   These scripts are designed to be executed *within* Blender and interact with Blender's `bpy` API.\r\n*   Consider how these scripts are invoked by the Asset Processor (via subprocess calls) and what data they expect (primarily from `metadata.json` and `sys.argv`).\r\n*   Refer to `08_Blender_Integration_Internals.md` for details on the execution mechanism and script specifics.\r\n\r\n## General Development Practices\r\n\r\n*   Adhere to the project's coding conventions (see `10_Coding_Conventions.md`).\r\n*   Utilize the standard Python `logging` module for outputting information and debugging messages.\r\n*   Use `try...except` blocks for error handling, and leverage the custom exceptions (`ConfigurationError`, `AssetProcessingError`) where appropriate.\r\n*   When working with file paths, use `pathlib.Path` for consistency and robustness.\r\n*   Be mindful of concurrency when working with the GUI or parallel processing in the CLI.\r\n\r\nThis workflow provides a general guide; specific tasks may require delving into multiple files and understanding the interactions between different components."
        }
    ]
}