# kiadtikun/mjxclothtool architecture

> Architecture diagram of the GitHub repository kiadtikun/mjxclothtool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kiadtikun/mjxclothtool
- Repository: https://github.com/kiadtikun/mjxclothtool

## Overview

grzyClothTool is a WPF application for creating and managing GTA V addon clothing packs. Users bring in drawable and texture assets, organize and inspect them in a project, preview clothing and props, then build pack resources; the README also documents automatic splitting when an addon exceeds the item limit. The graph preserves those product stages and CodeWalker-based previewing. Some capabilities are documented but their implementation was not sampled, so those relationships cite the README; unsampled details are not inferred.

Main entry points: [`grzyClothTool/Models/AddonManager.cs`](https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Models/AddonManager.cs) (Addon manager), [`grzyClothTool/Models/Drawable/GDrawable.cs`](https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Models/Drawable/GDrawable.cs) (Drawable model), [`CodeWalker/CodeWalker.Core/GameFiles/Resources/Texture.cs`](https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/GameFiles/Resources/Texture.cs) (Texture resources), [`grzyClothTool/Views/BuildWindow.xaml.cs`](https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Views/BuildWindow.xaml.cs) (Build window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_project["Project workflow"]
  node_project_ui["Project editor"]
  node_project_model["Addon manager<br/>[AddonManager.cs]"]
end

subgraph group_assets["Clothing assets"]
  node_asset_files["Asset files<br/>[FileHelper.cs]"]
  node_drawable_model["Drawable model<br/>[GDrawable.cs]"]
  node_texture_model["Texture model<br/>[GTexture.cs]"]
  node_duplicate_check["Duplicate detection"]
  node_drawable_format["Drawable resources<br/>[Drawable.cs]"]
  node_texture_format["Texture resources<br/>[Texture.cs]"]
  node_ytd_format["Texture dictionary<br/>[YtdFile.cs]"]
  node_rpf_format["RPF archives<br/>[RpfFile.cs]"]
  node_binary_io["Binary data I/O<br/>[Data.cs]"]
end

subgraph group_preview["3D preview"]
  node_preview_ui["Preview host"]
  node_renderer["3D renderer<br/>[Renderer.cs]"]
  node_shader_manager["Shader manager<br/>[ShaderManager.cs]"]
  node_bounds["Drawable bounds<br/>[Bounds.cs]"]
end

subgraph group_build["Pack output"]
  node_build_ui["Build window"]
  node_build_resource["Build resources"]
  node_xml_io["XML utilities<br/>[Xml.cs]"]
end

node_creator(("Clothing creator"))

node_creator -->|"manages packs"| node_project_ui
node_project_ui -->|"edits project"| node_project_model
node_project_model -->|"loads drawables"| node_drawable_model
node_project_model -->|"checks duplicates"| node_duplicate_check
node_project_model -->|"resolves files"| node_asset_files
node_drawable_model -->|"loads drawable data"| node_drawable_format
node_drawable_model -->|"loads textures"| node_texture_model
node_texture_model -->|"reads texture data"| node_texture_format
node_texture_format -.->|"reads binary data"| node_binary_io
node_ytd_format -.->|"contains textures"| node_texture_format
node_rpf_format -.->|"uses binary I/O"| node_binary_io
node_creator -->|"previews assets"| node_preview_ui
node_preview_ui -->|"hosts preview"| node_renderer
node_renderer -.->|"uses shaders"| node_shader_manager
node_creator -->|"builds packs"| node_build_ui
node_build_ui -.->|"creates resources"| node_build_resource
node_build_resource -.->|"writes metadata"| node_xml_io
node_project_model -.->|"splits oversized packs"| node_build_ui

click node_project_ui "https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Views/ProjectWindow.xaml.cs"
click node_project_model "https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Models/AddonManager.cs"
click node_asset_files "https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Helpers/FileHelper.cs"
click node_drawable_model "https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Models/Drawable/GDrawable.cs"
click node_texture_model "https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Models/Texture/GTexture.cs"
click node_duplicate_check "https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Helpers/DuplicateDetector.cs"
click node_drawable_format "https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/GameFiles/Resources/Drawable.cs"
click node_texture_format "https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/GameFiles/Resources/Texture.cs"
click node_ytd_format "https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/GameFiles/FileTypes/YtdFile.cs"
click node_rpf_format "https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/GameFiles/RpfFile.cs"
click node_binary_io "https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/GameFiles/Utils/Data.cs"
click node_preview_ui "https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Controls/PreviewWindowHost.xaml.cs"
click node_renderer "https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker/Rendering/Renderer.cs"
click node_shader_manager "https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker/Rendering/ShaderManager.cs"
click node_bounds "https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/GameFiles/Resources/Bounds.cs"
click node_build_ui "https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Views/BuildWindow.xaml.cs"
click node_build_resource "https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Helpers/BuildResourceHelper.cs"
click node_xml_io "https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/Utils/Xml.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_project_ui,node_project_model toneBlue
class node_asset_files,node_drawable_model,node_texture_model,node_duplicate_check,node_drawable_format,node_texture_format,node_ytd_format,node_rpf_format,node_binary_io toneAmber
class node_preview_ui,node_renderer,node_shader_manager,node_bounds toneMint
class node_build_ui,node_build_resource,node_xml_io toneRose
class node_creator toneIndigo
```

## Components

### Project workflow

- [Project editor](https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Views/ProjectWindow.xaml.cs): `grzyClothTool/Views/ProjectWindow.xaml.cs`
- [Addon manager](https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Models/AddonManager.cs): `grzyClothTool/Models/AddonManager.cs`

### Clothing assets

- [Asset files](https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Helpers/FileHelper.cs): `grzyClothTool/Helpers/FileHelper.cs`
- [Drawable model](https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Models/Drawable/GDrawable.cs): `grzyClothTool/Models/Drawable/GDrawable.cs`
- [Texture model](https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Models/Texture/GTexture.cs): `grzyClothTool/Models/Texture/GTexture.cs`
- [Duplicate detection](https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Helpers/DuplicateDetector.cs): `grzyClothTool/Helpers/DuplicateDetector.cs`
- [Drawable resources](https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/GameFiles/Resources/Drawable.cs): `CodeWalker/CodeWalker.Core/GameFiles/Resources/Drawable.cs`
- [Texture resources](https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/GameFiles/Resources/Texture.cs): `CodeWalker/CodeWalker.Core/GameFiles/Resources/Texture.cs`
- [Texture dictionary](https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/GameFiles/FileTypes/YtdFile.cs): `CodeWalker/CodeWalker.Core/GameFiles/FileTypes/YtdFile.cs`
- [RPF archives](https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/GameFiles/RpfFile.cs): `CodeWalker/CodeWalker.Core/GameFiles/RpfFile.cs`
- [Binary data I/O](https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/GameFiles/Utils/Data.cs): `CodeWalker/CodeWalker.Core/GameFiles/Utils/Data.cs`

### 3D preview

- [Preview host](https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Controls/PreviewWindowHost.xaml.cs): `grzyClothTool/Controls/PreviewWindowHost.xaml.cs`
- [3D renderer](https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker/Rendering/Renderer.cs): `CodeWalker/CodeWalker/Rendering/Renderer.cs`
- [Shader manager](https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker/Rendering/ShaderManager.cs): `CodeWalker/CodeWalker/Rendering/ShaderManager.cs`
- [Drawable bounds](https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/GameFiles/Resources/Bounds.cs): `CodeWalker/CodeWalker.Core/GameFiles/Resources/Bounds.cs`

### Pack output

- [Build window](https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Views/BuildWindow.xaml.cs): `grzyClothTool/Views/BuildWindow.xaml.cs`
- [Build resources](https://github.com/kiadtikun/mjxclothtool/blob/master/grzyClothTool/Helpers/BuildResourceHelper.cs): `grzyClothTool/Helpers/BuildResourceHelper.cs`
- [XML utilities](https://github.com/kiadtikun/mjxclothtool/blob/master/CodeWalker/CodeWalker.Core/Utils/Xml.cs): `CodeWalker/CodeWalker.Core/Utils/Xml.cs`

### Other components

- **Clothing creator**

## Connections

- Clothing creator → Project editor: manages packs
- Project editor → Addon manager: edits project (evidence: `grzyClothTool/Views/ProjectWindow.xaml.cs`)
- Addon manager → Drawable model: loads drawables (evidence: `grzyClothTool/Models/AddonManager.cs`)
- Addon manager → Duplicate detection: checks duplicates (evidence: `grzyClothTool/Models/AddonManager.cs`)
- Addon manager → Asset files: resolves files (evidence: `grzyClothTool/Models/AddonManager.cs`)
- Drawable model → Drawable resources: loads drawable data (evidence: `grzyClothTool/Models/Drawable/GDrawable.cs`)
- Drawable model → Texture model: loads textures (evidence: `grzyClothTool/Models/Drawable/GDrawable.cs`)
- Texture model → Texture resources: reads texture data (evidence: `grzyClothTool/Models/Texture/GTexture.cs`)
- Texture resources → Binary data I/O: reads binary data (evidence: `CodeWalker/CodeWalker.Core/GameFiles/Resources/Texture.cs`)
- Texture dictionary → Texture resources: contains textures
- RPF archives → Binary data I/O: uses binary I/O
- Clothing creator → Preview host: previews assets
- Preview host → 3D renderer: hosts preview (evidence: `grzyClothTool/Controls/PreviewWindowHost.xaml.cs`)
- 3D renderer → Shader manager: uses shaders
- Clothing creator → Build window: builds packs
- Build window → Build resources: creates resources
- Build resources → XML utilities: writes metadata
- Addon manager → Build window: splits oversized packs
