# creativelyons/nukesurvivaltoolkit_publicrelease architecture

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

- Interactive diagram: https://gitdiagram.com/creativelyons/nukesurvivaltoolkit_publicrelease
- Repository: https://github.com/creativelyons/nukesurvivaltoolkit_publicrelease

## Overview

##### Project Type and Purpose
- This project is a portable toolkit developed to extend the functionality of Nuke. Its primary purpose is to offer a curated collection of gizmos (node tools) that users can integrate into their Nuke environment to simplify tasks, keying, compositing manipulations, and more.
- The README clearly explains that it is installed by simply adding the toolkit’s folder path via nuke.pluginAddPath in your Nuke init.py. This means the system is less about a standalone application and more about an integrated set of tools within an existing host (Nuke).

##### Analyzing the File Structure
- At the top level, the project contains a folder called “NukeSurvivalToolkit” along with general project files (.gitignore, LICENSE, README, etc.).
- Within “NukeSurvivalToolkit”, there are several important directories:
- gizmos – This folder holds hundreds of .gizmo files that represent the various custom nodes. Each gizmo file corresponds to a tool meant for image processing, keying, 3D effects, and many other visual effects tasks.
- nk_files – This directory contains multiple .nk files which are Nuke script examples or templates. They demonstrate how to set up, use, or test some of the gizmos provided.
- python – This folder includes supporting Python scripts (e.g., NST_ID_Extractor.py, NST_VectorTracker.py, NST_cardToTrack.py, etc.) that add supplemental functionality to the gizmos or assist in their integration.
- menu.py and init.py – Other critical files that are involved in integrating the toolkit with Nuke. The init.py file is used by the user’s Nuke environment to locate the toolkit, and menu.py is likely responsible for adding the custom menu items to the Nuke toolbar.
- Additional files such as documentation PDFs and images help the user understand and install the toolkit.

a. Nuke Host Application (External System): This is the environment where the toolkit is loaded.
b. Toolkit Integration Layer:
- init.py / menu.py: These files handle the configuration and insertion of the custom tool menu into Nuke.
c. Core Functional Modules:
- Gizmos (Custom node tools): Represent all the .gizmo files as a consolidated group. They function as the primary tools available inside the menu.
- NK Files (Example Scripts/Templates): These are used as demonstrations or starting points for setting up node trees. They show how various gizmos might be connected in real-world scenarios.
d. Assets and Documentation:

##### Relationships and Interactions
- The Nuke Host Application loads the toolkit via a plugin path defined in the init.py file.
- Once loaded, the menu.py file registers the new toolbar, effectively grouping all the gizmos.
- Example nk_files illustrate data flow and node connections within a typical Nuke compositing pipeline that uses the toolkit’s gizmos.

##### Architectural Patterns and Design Principles
- Modularity: The clear separation between gizmos, Python scripts, and nk example files demonstrates an emphasis on modular design. Each module (or directory) fulfills its own role.
- Extensibility: The system is designed to be easily expanded. Adding a new tool involves dropping a new gizmo or Python script in the appropriate folder.
- Integration via Configuration: The use of a simple init.py modification means the toolkit adheres to the host application’s extension protocols.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Global External System
    NukeHost["Nuke Host Application"]:::external

    %% Toolkit Integration Layer
    subgraph "Toolkit Integration"
        init["init.py"]:::integration
        menu["menu.py"]:::integration
    end

    %% Custom Gizmos
    subgraph "Custom Gizmos"
        gizmoDir["Gizmos Directory (.gizmo files)"]:::gizmo
        fastGizmo["FastComplexity_Distort.gizmo"]:::gizmo
    end

    %% Supporting Python Modules
    subgraph "Python Modules"
        pyMod["Python Scripts Directory"]:::python
    end

    %% Example NK Files
    subgraph "NK Files"
        nkFiles["NK Files Directory (.nk files)"]:::nk
    end

    %% Assets and Documentation
    subgraph "Assets/Documentation"
        icons["Icons Directory"]:::assets
        images["Images Directory"]:::assets
        doc["Documentation PDF"]:::assets
    end

    %% Relationships and Data Flow
    NukeHost -->|"loads_via_pluginAddPath"| init
    NukeHost -->|"loads_via_pluginAddPath"| menu

    init -->|"integrates"| gizmoDir
    menu -->|"registers_menu"| gizmoDir
    gizmoDir -->|"example_file"| fastGizmo

    init -->|"calls_scripts"| pyMod
    menu -->|"calls_scripts"| pyMod

    init -->|"links_templates"| nkFiles
    menu -->|"links_templates"| nkFiles

    menu -->|"uses_assets"| icons
    menu -->|"uses_assets"| images

    icons -->|"documentation_associated"| doc

    %% Click Events - Toolkit Integration
    click init "https://github.com/creativelyons/nukesurvivaltoolkit_publicrelease/blob/master/NukeSurvivalToolkit/init.py"
    click menu "https://github.com/creativelyons/nukesurvivaltoolkit_publicrelease/blob/master/NukeSurvivalToolkit/menu.py"

    %% Click Events - Custom Gizmos
    click gizmoDir "https://github.com/creativelyons/nukesurvivaltoolkit_publicrelease/tree/master/NukeSurvivalToolkit/gizmos"
    click fastGizmo "https://github.com/creativelyons/nukesurvivaltoolkit_publicrelease/blob/master/NukeSurvivalToolkit/FastComplexity_Distort.gizmo"

    %% Click Events - Supporting Python Modules
    click pyMod "https://github.com/creativelyons/nukesurvivaltoolkit_publicrelease/tree/master/NukeSurvivalToolkit/python"

    %% Click Events - Example NK Files
    click nkFiles "https://github.com/creativelyons/nukesurvivaltoolkit_publicrelease/tree/master/NukeSurvivalToolkit/nk_files"

    %% Click Events - Assets and Documentation
    click icons "https://github.com/creativelyons/nukesurvivaltoolkit_publicrelease/tree/master/NukeSurvivalToolkit/icons"
    click images "https://github.com/creativelyons/nukesurvivaltoolkit_publicrelease/tree/master/NukeSurvivalToolkit/images"
    click doc "https://github.com/creativelyons/nukesurvivaltoolkit_publicrelease/blob/master/NukeSurvivalToolkit/NukeSurvivalToolkit_Documentation_Release_v2.1.0.pdf"

    %% Styles
    classDef external fill:#ffe6e6,stroke:#cc0000,stroke-width:2px,fill-opacity:0.5
    classDef integration fill:#e6f7ff,stroke:#0073e6,stroke-width:2px,fill-opacity:0.5
    classDef gizmo fill:#e6ffe6,stroke:#009933,stroke-width:2px,fill-opacity:0.5
    classDef python fill:#fff0e6,stroke:#ff6600,stroke-width:2px,fill-opacity:0.5
    classDef nk fill:#e6f2ff,stroke:#3366cc,stroke-width:2px,fill-opacity:0.5
    classDef assets fill:#ffffe6,stroke:#cccc00,stroke-width:2px,fill-opacity:0.5
```
