# jbmol/tool_chainsplitter architecture

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

- Interactive diagram: https://gitdiagram.com/jbmol/tool_chainsplitter
- Repository: https://github.com/jbmol/tool_chainsplitter

## Overview

Chain Splitter is a Maya tool for inserting evenly spaced intermediate joints along a selected joint chain. A user launches the UI, selects the first joint, updates the chain selection, chooses a division count, and invokes splitting; the core discovers descendants and edits the Maya scene. The graph separates launch, UI/session state, and chain operations. README and excerpts support the main runtime path; no separate persistence layer is shown.

Main entry points: [`chain_splitter_tool/ui.py`](https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/ui.py) (Maya UI and Callbacks), [`chain_splitter_tool/launcher.py`](https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/launcher.py) (Package Entrypoint), [`chain_splitter_tool/core.py`](https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/core.py) (Chain Splitting), [`ChainSplitter_Launcher.py`](https://github.com/jbmol/tool_chainsplitter/blob/main/ChainSplitter_Launcher.py) (Single-file Launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launch"]
  node_single_launcher["Single-file Launcher"]
  node_package_launcher["Package Entrypoint<br/>[launcher.py]"]
end

subgraph group_interface["UI and State"]
  node_ui["Maya UI and Callbacks<br/>[ui.py]"]
  node_session_state["UI Session State<br/>[state.py]"]
  node_ui_constants["UI Constants<br/>[constants.py]"]
end

subgraph group_operations["Chain Operations"]
  node_chain_discovery["Joint Chain Discovery<br/>[core.py]"]
  node_chain_validation["Chain Validation<br/>[core.py]"]
  node_chain_split["Chain Splitting<br/>[core.py]"]
end

node_maya_user(("Maya User"))
node_maya_scene[("Maya Scene")]

node_maya_user -->|"launches"| node_single_launcher
node_maya_user -->|"launches"| node_package_launcher
node_single_launcher -->|"delegates to"| node_package_launcher
node_package_launcher -->|"creates state"| node_session_state
node_package_launcher -->|"opens"| node_ui
node_ui -->|"uses labels"| node_ui_constants
node_ui -->|"reads and updates"| node_session_state
node_ui -->|"discovers chain"| node_chain_discovery
node_ui -->|"requests split"| node_chain_split
node_chain_split -->|"validates"| node_chain_validation
node_chain_discovery -->|"reads joints"| node_maya_scene
node_ui -->|"reads selection"| node_maya_scene
node_ui -->|"updates selection"| node_maya_scene
node_chain_split -->|"edits hierarchy"| node_maya_scene

click node_single_launcher "https://github.com/jbmol/tool_chainsplitter/blob/main/ChainSplitter_Launcher.py"
click node_package_launcher "https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/launcher.py"
click node_ui "https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/ui.py"
click node_session_state "https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/state.py"
click node_ui_constants "https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/constants.py"
click node_chain_discovery "https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/core.py"
click node_chain_validation "https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/core.py"
click node_chain_split "https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/core.py"

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_single_launcher,node_package_launcher,node_maya_user toneBlue
class node_ui,node_session_state,node_ui_constants,node_maya_scene toneAmber
class node_chain_discovery,node_chain_validation,node_chain_split toneMint
```

## Components

### Launch

- [Single-file Launcher](https://github.com/jbmol/tool_chainsplitter/blob/main/ChainSplitter_Launcher.py): `ChainSplitter_Launcher.py`
- [Package Entrypoint](https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/launcher.py): `chain_splitter_tool/launcher.py`

### UI and State

- [Maya UI and Callbacks](https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/ui.py): `chain_splitter_tool/ui.py`
- [UI Session State](https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/state.py): `chain_splitter_tool/state.py`
- [UI Constants](https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/constants.py): `chain_splitter_tool/constants.py`

### Chain Operations

- [Joint Chain Discovery](https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/core.py): `chain_splitter_tool/core.py`
- [Chain Validation](https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/core.py): `chain_splitter_tool/core.py`
- [Chain Splitting](https://github.com/jbmol/tool_chainsplitter/blob/main/chain_splitter_tool/core.py): `chain_splitter_tool/core.py`

### Other components

- **Maya User**
- **Maya Scene**

## Connections

- Maya User → Single-file Launcher: launches (evidence: `ChainSplitter_Launcher.py`)
- Maya User → Package Entrypoint: launches (evidence: `README.txt`)
- Single-file Launcher → Package Entrypoint: delegates to (evidence: `ChainSplitter_Launcher.py`)
- Package Entrypoint → UI Session State: creates state (evidence: `chain_splitter_tool/launcher.py`)
- Package Entrypoint → Maya UI and Callbacks: opens (evidence: `chain_splitter_tool/launcher.py`)
- Maya UI and Callbacks → UI Constants: uses labels (evidence: `chain_splitter_tool/ui.py`)
- Maya UI and Callbacks → UI Session State: reads and updates (evidence: `chain_splitter_tool/ui.py`)
- Maya UI and Callbacks → Joint Chain Discovery: discovers chain (evidence: `chain_splitter_tool/ui.py`)
- Maya UI and Callbacks → Chain Splitting: requests split (evidence: `chain_splitter_tool/ui.py`)
- Chain Splitting → Chain Validation: validates (evidence: `chain_splitter_tool/core.py`)
- Joint Chain Discovery → Maya Scene: reads joints (evidence: `chain_splitter_tool/core.py`)
- Maya UI and Callbacks → Maya Scene: reads selection (evidence: `chain_splitter_tool/ui.py`)
- Maya UI and Callbacks → Maya Scene: updates selection (evidence: `chain_splitter_tool/ui.py`)
- Chain Splitting → Maya Scene: edits hierarchy (evidence: `chain_splitter_tool/core.py`)
