# soupday/ccic-blender-pipeline-plugin architecture

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

- Interactive diagram: https://gitdiagram.com/soupday/ccic-blender-pipeline-plugin
- Repository: https://github.com/soupday/ccic-blender-pipeline-plugin

## Overview

1. **What this repository is**
   - A Python plugin for **Character Creator 4 / iClone 8** that acts as a bridge to **Blender**.
   - It is designed around a round-trip pipeline: export characters/props/motions from Reallusion, edit in Blender with a matching Blender add-on, then re-import or live-sync back.

2. **Primary runtime boundary**
   - The code runs inside the **Reallusion Python plugin environment** when installed under `Bin64/OpenPlugin`.
   - `main.py` is the top-level entry point, and the README also says it can be launched directly from **Script > Load Python** without full installation.
   - The repo also includes install/uninstall PowerShell and BAT wrappers, indicating deployment is part of the project boundary.

3. **UI and user interaction layer**
   - `btp/qt.py`, `btp/prefs.py`, and `btp/options.py` define the plugin’s user-facing controls, settings, and persistent configuration.
   - The main user workflows surfaced in the README are grouped as **Go-B**, **Export**, **Import**, **DataLink**, and **Settings**.
   - `btp/error.py` likely centralizes user-visible error handling and warnings.

4. **Host-application integration**
   - `btp/cc.py` is the Reallusion-side integration layer, likely wrapping Character Creator / iClone APIs for scene access, selection, export/import actions, and object metadata.
   - `btp/blender.py` is the Blender-side orchestration layer, responsible for launching Blender, exchanging files/commands, and coordinating round-trip behavior.
   - These two files form the main boundary between the host app and the external Blender environment.

5. **Transfer and connection subsystem**
   - `btp/link.py` is the core “bridge” layer, and the changelog references **DataLink**, remote transfer, live sequence sync, and connection management.
   - This subsystem appears to handle both local and remote communication paths, including maintaining or replacing a Blender connection and pushing scene updates over a working directory.
   - The README’s “Send Scene”, “Select Scene”, and live sequence features suggest this is the long-lived synchronization channel.

6. **Export pipeline**
   - `btp/exporter.py` handles extraction from CC/iClone into Blender-facing artifacts.
   - Based on the README, export includes characters, props, motions, lights, cameras, and scene data, with special handling for material names, textures, FBX compliance, and JSON metadata.
   - The export path is tightly coupled to the Blender add-on contract: object/material naming, texture-path rewriting, and metadata updates must line up for re-import to succeed.

7. **Import / reconstruction pipeline**
   - `btp/importer.py` handles reconstruction on the CC/iClone side from Blender output.
   - The README emphasizes exact material reconstruction from exported JSON and compatibility constraints around object names, material names, and texture references.
   - This is the key “restore state” boundary: geometry, materials, and some character metadata come back from Blender into the Reallusion scene.

8. **Morph and mesh-edit workflows**
   - `btp/morph.py` and the changelog entries around “Go-B Morph”, mesh replace, and facial profile editing indicate a specialized path for morph-target or mesh-only updates.
   - The plugin supports exact mesh replacement and slider-based morph workflows, which are distinct from full-character export/import.
   - This path is important because it can omit the armature or send mesh-only updates for facial editing and similar use cases.

9. **Utility and data model layer**
   - `btp/utils.py`, `btp/vars.py`, and `btp/gob.py` are support modules for shared helpers, constants/state, and the Go-B workflow.
   - `btp/gob.py` is especially likely to coordinate the “one-click send to Blender and return” flow described in the README.
   - `btp/gob.py` plus the main export/import modules suggests a workflow-oriented layer sitting above lower-level file transfer and API calls.

10. **Packaging, scripts, and test support**
   - `scripts/go_b.py` and `scripts/transformer_fix.py` are auxiliary scripts, likely used for Blender-side automation and compatibility fixes.
   - `btp/tests.py` indicates some internal test coverage or validation helpers, though the repo is primarily an integration plugin rather than a standalone test-driven library.
   - `Installation - README.txt`, `InstallScript.ps1`, and uninstall counterparts show the plugin is meant to be installed as a folder-based package or junction link.

11. **External dependencies and file formats**
   - The architecture revolves around **FBX** plus companion **JSON** metadata exported by the Blender tools add-on.
   - It also relies on Reallusion-specific concepts like **HIK profiles**, **facial profiles**, **physics data**, **motions**, and **accessories/props**.
   - Textures and material parameters are significant data flows; the README warns that embedded textures break the re-import path because the plugin expects filesystem-accessible asset paths.

12. **End-to-end data flow**
   - Typical flow: CC/iClone scene state → plugin export logic → FBX/JSON/filesystem → Blender edit/automation → updated FBX/JSON or live DataLink updates → plugin import/reconstruction back into CC/iClone.
   - A second flow bypasses file round-tripping and uses **DataLink** for live scene, pose, motion, camera, and light synchronization.
   - The architecture is therefore split into a **batch pipeline** and a **live sync pipeline**, both anchored by shared naming/metadata conventions.

Main entry points: [`btp/exporter.py`](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/exporter.py) (Export Pipeline), [`btp/importer.py`](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/importer.py) (Import Pipeline), [`btp/gob.py`](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/gob.py) (Go-B Flow), [`btp/qt.py`](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/qt.py) (Qt UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_runtime["Runtime"]
  node_node_main["Plugin Entry<br/>entrypoint<br/>[main.py]"]
  node_node_cc["CC Bridge<br/>host-api<br/>[cc.py]"]
  node_node_blender["Blender Bridge<br/>external-orchestrator<br/>[blender.py]"]
end

subgraph group_group_pipeline["Pipelines"]
  node_node_link["DataLink<br/>sync-channel<br/>[link.py]"]
  node_node_exporter["Export Pipeline<br/>batch-export<br/>[exporter.py]"]
  node_node_importer["Import Pipeline<br/>reconstruction<br/>[importer.py]"]
  node_node_gob{{"Go-B Flow<br/>workflow-coordinator<br/>[gob.py]"}}
  node_node_morph["Morph Tools<br/>mesh-edit-flow<br/>[morph.py]"]
end

subgraph group_group_ui["UI & Settings"]
  node_node_prefs["Preferences<br/>persistent-settings<br/>[prefs.py]"]
  node_node_options["Options<br/>ui-model<br/>[options.py]"]
  node_node_qt["Qt UI<br/>interface<br/>[qt.py]"]
  node_node_error["Errors<br/>user-feedback<br/>[error.py]"]
end

subgraph group_group_support["Support"]
  node_node_utils["Utilities<br/>shared-helpers<br/>[utils.py]"]
  node_node_vars["Vars<br/>constants-state<br/>[vars.py]"]
  node_node_init["Package Init<br/>[__init__.py]"]
  node_node_tests["Tests<br/>validation<br/>[tests.py]"]
  node_node_script_go_b["Go-B Script<br/>automation-script<br/>[go_b.py]"]
  node_node_script_fix["Fix Script<br/>compatibility-script<br/>[transformer_fix.py]"]
end

node_node_main -->|"opens UI"| node_node_qt
node_node_main -->|"uses host API"| node_node_cc
node_node_main -->|"starts workflow"| node_node_gob
node_node_qt -->|"reads/writes"| node_node_prefs
node_node_qt -->|"configures"| node_node_options
node_node_qt -->|"reports"| node_node_error
node_node_gob -->|"exports"| node_node_exporter
node_node_gob -->|"hands off to"| node_node_blender
node_node_gob -->|"returns via"| node_node_importer
node_node_exporter -->|"pulls scene data"| node_node_cc
node_node_exporter -->|"shares helpers"| node_node_utils
node_node_exporter -->|"uses state"| node_node_vars
node_node_importer -->|"rebuilds scene"| node_node_cc
node_node_importer -->|"shares helpers"| node_node_utils
node_node_link -->|"syncs with"| node_node_blender
node_node_link -->|"syncs scene"| node_node_cc
node_node_morph -->|"specializes export"| node_node_exporter
node_node_morph -->|"specializes import"| node_node_importer
node_node_script_go_b -.->|"supports"| node_node_blender
node_node_script_fix -.->|"supports"| node_node_blender
node_node_tests -.->|"validates"| node_node_exporter
node_node_tests -.->|"validates"| node_node_importer
node_node_init -.->|"exposes"| node_node_utils

click node_node_main "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/main.py"
click node_node_cc "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/cc.py"
click node_node_blender "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/blender.py"
click node_node_link "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/link.py"
click node_node_exporter "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/exporter.py"
click node_node_importer "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/importer.py"
click node_node_gob "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/gob.py"
click node_node_morph "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/morph.py"
click node_node_prefs "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/prefs.py"
click node_node_options "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/options.py"
click node_node_qt "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/qt.py"
click node_node_error "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/error.py"
click node_node_utils "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/utils.py"
click node_node_vars "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/vars.py"
click node_node_init "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/__init__.py"
click node_node_tests "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/tests.py"
click node_node_script_go_b "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/scripts/go_b.py"
click node_node_script_fix "https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/scripts/transformer_fix.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_node_main,node_node_cc,node_node_blender toneBlue
class node_node_link,node_node_exporter,node_node_importer,node_node_gob,node_node_morph toneAmber
class node_node_prefs,node_node_options,node_node_qt,node_node_error toneMint
class node_node_utils,node_node_vars,node_node_init,node_node_tests,node_node_script_go_b,node_node_script_fix toneRose
```

## Components

### Runtime

Plugin entrypoint and host integration boundary.

- [Plugin Entry](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/main.py): entrypoint · Top-level launcher for the Reallusion Python plugin and direct script loading. · `main.py`
- [CC Bridge](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/cc.py): host-api · Reallusion-side integration layer for scene access and host operations. · `btp/cc.py`
- [Blender Bridge](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/blender.py): external-orchestrator · Coordinates Blender launch, handoff, and round-trip orchestration. · `btp/blender.py`

### Pipelines

Batch export/import, round-trip workflows, and live sync.

- [DataLink](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/link.py): sync-channel · Long-lived connection and remote transfer channel for live scene synchronization. · `btp/link.py`
- [Export Pipeline](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/exporter.py): batch-export · Builds FBX, JSON, and asset metadata for Blender-side editing. · `btp/exporter.py`
- [Import Pipeline](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/importer.py): reconstruction · Reconstructs CC/iClone scene state from Blender output and metadata. · `btp/importer.py`
- [Go-B Flow](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/gob.py): workflow-coordinator · One-click round-trip workflow that ties export, Blender handoff, and return import together. · `btp/gob.py`
- [Morph Tools](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/morph.py): mesh-edit-flow · Specialized path for morph targets, mesh replacement, and facial editing updates. · `btp/morph.py`

### UI & Settings

User-facing controls and persistent configuration.

- [Preferences](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/prefs.py): persistent-settings · Stores plugin preferences and user configuration state. · `btp/prefs.py`
- [Options](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/options.py): ui-model · Defines workflow options and user-selectable parameters. · `btp/options.py`
- [Qt UI](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/qt.py): interface · Plugin dialogs, controls, and interactive UI widgets. · `btp/qt.py`
- [Errors](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/error.py): user-feedback · Centralized user-visible warnings and error handling. · `btp/error.py`

### Support

Shared utilities, data model, packaging, and scripts.

- [Utilities](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/utils.py): shared-helpers · Common helper functions used across the plugin. · `btp/utils.py`
- [Vars](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/vars.py): constants-state · Shared constants and module-level state used by workflows. · `btp/vars.py`
- [Package Init](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/__init__.py): package · Package marker and public import surface. · `btp/__init__.py`
- [Tests](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/btp/tests.py): validation · Internal test and validation helpers. · `btp/tests.py`
- [Go-B Script](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/scripts/go_b.py): automation-script · Auxiliary script for Blender-side Go-B automation. · `scripts/go_b.py`
- [Fix Script](https://github.com/soupday/ccic-blender-pipeline-plugin/blob/main/scripts/transformer_fix.py): compatibility-script · Auxiliary script for transformer or compatibility fixes. · `scripts/transformer_fix.py`

## Connections

- Plugin Entry → Qt UI: opens UI · Loads the interactive plugin interface.
- Plugin Entry → CC Bridge: uses host API · Connects the entrypoint to Reallusion scene operations.
- Plugin Entry → Go-B Flow: starts workflow · Routes one-click round-trip actions into the Go-B coordinator.
- Qt UI → Preferences: reads/writes · Persists user choices and plugin preferences.
- Qt UI → Options: configures · Collects workflow parameters and mode settings.
- Qt UI → Errors: reports · Surfaces warnings and failures to the user.
- Go-B Flow → Export Pipeline: exports · Triggers the batch export stage.
- Go-B Flow → Blender Bridge: hands off to · Launches or coordinates Blender-side processing.
- Go-B Flow → Import Pipeline: returns via · Restores scene state after Blender edits.
- Export Pipeline → CC Bridge: pulls scene data · Extracts characters, props, motion, and scene metadata from the host.
- Export Pipeline → Utilities: shares helpers · Uses common file, naming, and path utilities.
- Export Pipeline → Vars: uses state · Relies on shared constants and workflow flags.
- Import Pipeline → CC Bridge: rebuilds scene · Applies imported geometry and material state back into the host app.
- Import Pipeline → Utilities: shares helpers · Uses common reconstruction and path utilities.
- DataLink → Blender Bridge: syncs with · Maintains live communication with Blender for DataLink workflows.
- DataLink → CC Bridge: syncs scene · Transfers live scene, pose, motion, camera, and light updates.
- Morph Tools → Export Pipeline: specializes export · Uses the export pipeline for morph and mesh-edit variants.
- Morph Tools → Import Pipeline: specializes import · Feeds updated meshes or morph data back through reconstruction.
- Go-B Script → Blender Bridge: supports · Provides Blender-side automation for Go-B flows.
- Fix Script → Blender Bridge: supports · Applies compatibility fixes on the Blender side.
- Tests → Export Pipeline: validates · Checks export behavior and output conventions.
- Tests → Import Pipeline: validates · Checks import behavior and reconstruction constraints.
- Package Init → Utilities: exposes · Connects package imports to shared helpers.
