WP Manifestindependent plugin directory
manifest / editor / blender-node-diagram

Blender Node Diagram

A mad scientists' attempt at creating custom Gutenberg blocks for WordPress that allows Blender-loving bloggers to create beautiful node visuals to accompany their posts πŸͺ„βœ¨

β˜… 0stars
7release downloads
v1.0.0latest Β· 5mo ago

Install

Download blender-node-diagram.zip From the v1.0.0 release on GitHub, Apr 26, 2026

Upload it under Plugins β†’ Add New Plugin β†’ Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/psydreamer-3d/blender-node-diagram/releases/download/v1.0.0/blender-node-diagram.zip
No built-in updater. New versions won't appear under Dashboard β†’ Updates. Install new releases yourself, or let Git Updater track the repository.

Blender Node Diagram β€” WordPress Block Plugin

Two Gutenberg blocks for rendering Blender shader node diagrams as interactive, scrollable SVGs. Ships with three Blinn-Phong presets, a full-screen visual diagram builder for custom node networks, and a static N/L/V/H concept illustration block.


Blocks

1. Blender Node Diagram (blender-node-diagram/diagram)

A data-driven SVG renderer. Three preset variations appear directly in the block inserter under the Media category:

Variation Preset key Diagram width
Blinn-Phong Node Chain blinn ~1 710 px
Sharpness Sub-Network sharp ~930 px
Full NPR Glossy Group group ~2 260 px

All diagrams scroll horizontally inside a dot-grid container that matches Blender's node editor aesthetic. The frontend renderer (view.js) is only enqueued on pages that contain the block β€” no overhead on unrelated pages.

Switching the type to Custom (JSON) adds two options in the inspector:

  • Open Diagram Builder β€” full-screen visual node editor (see below)
  • Raw JSON textarea β€” paste/edit the { nodes, connections } object directly

2. Blinn-Phong Vector Diagram (blender-node-diagram/concept)

A static illustration of the N, L, V, H vector geometry at a shading point. The SVG is embedded directly in the post HTML at save time β€” no frontend script needed. The only editable attribute is the caption text.


Diagram Builder

The visual editor opens full-screen as a WordPress Modal.

β”Œβ”€ Left panel (380 px) ────────────┬─ Right panel (flex) ───────────────┐
β”‚  NODES  (3)        [Auto-layout] β”‚                                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚   Live dot-grid SVG preview        β”‚
β”‚  β”‚ geo  (geometry)  [Edit][βœ•] β”‚  β”‚   Re-renders in real-time as       β”‚
β”‚  β”‚  β–Ύ accordion edit form     β”‚  β”‚   you edit each node               β”‚
β”‚  β”‚    ID / Type / Label / X,Y β”‚  β”‚                                    β”‚
β”‚  β”‚    Inputs  [+ Add]         β”‚  β”‚                                    β”‚
β”‚  β”‚    Outputs [+ Add]         β”‚  β”‚                                    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚                                    β”‚
β”‚                                  β”‚                                    β”‚
β”‚  CONNECTIONS  (2)                β”‚                                    β”‚
β”‚  geo[0] β†’ dot[0]           [βœ•]   β”‚                                    β”‚
β”‚  β”Œβ”€ Add Connection ───────────┐  β”‚                                    β”‚
β”‚  β”‚  From node  Out #          β”‚  β”‚                                    β”‚
β”‚  β”‚  To node    In  #   [Add]  β”‚  β”‚                                    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚                                    β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  3 nodes / 2 connections                  [Cancel]  [Apply to Block]  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Editing a node opens an accordion form covering:

  • ID β€” the string key used in connections
  • Type β€” controls header colour
  • Label β€” use \n for a two-line header
  • X / Y β€” explicit position (Auto-layout resets these)
  • Input / Output sockets β€” label + type selector with a live colour dot

Auto-layout runs topological BFS and spaces nodes left-to-right by connection depth (190 px horizontal, 160 px vertical per slot).

Add Connection validates that the output/input indices are in range before adding, and reports the error inline if they are not.

Apply to Block writes the finished JSON to customData and closes the modal. The in-editor SVG preview updates immediately.


Custom JSON format

{
  "nodes": [
    {
      "id":      "geo",
      "type":    "geometry",
      "label":   "Geometry",
      "x":       10,
      "y":       80,
      "inputs":  [],
      "outputs": [
        { "label": "Normal",   "type": "vector" },
        { "label": "Incoming", "type": "vector" }
      ]
    }
  ],
  "connections": [
    { "from": "geo", "fromOut": 0, "to": "dot", "toIn": 0 }
  ]
}

Node types β†’ header colours

type Colour
geometry Teal
vectorMath Blue
math Green
value Grey
emission Purple
output Dark red
groupIn Amber
groupOut Amber

Socket types β†’ wire colours

type Colour
vector Purple
value Grey
shader Green
color Gold

Installation (no build step needed)

  1. Download blender-node-diagram.zip
  2. WordPress admin β†’ Plugins β†’ Add New β†’ Upload Plugin
  3. Activate

Development

npm install
npm run build   # production build β†’ build/
npm run start   # watch mode

Requires Node.js 20+.

File structure

blender-node-diagram/
β”œβ”€β”€ blender-node-diagram.php   Plugin entry β€” registers both blocks
β”œβ”€β”€ block.json                 Diagram block metadata
β”œβ”€β”€ concept-block.json         Concept block metadata
β”œβ”€β”€ package.json
β”œβ”€β”€ webpack.config.js
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.js               Block registration + variation declarations
β”‚   β”œβ”€β”€ edit.js                Diagram block editor component
β”‚   β”œβ”€β”€ save.js                Diagram block save function
β”‚   β”œβ”€β”€ view.js                Frontend renderer init
β”‚   β”œβ”€β”€ renderer.js            SVG rendering engine (no WP dependencies)
β”‚   β”œβ”€β”€ diagrams.js            Preset data + getDiagramData()
β”‚   β”œβ”€β”€ constants.js           Node/socket type maps and colours
β”‚   β”œβ”€β”€ diagram-builder.js     Full-screen visual diagram builder modal
β”‚   β”œβ”€β”€ concept-edit.js        Concept block editor component
β”‚   β”œβ”€β”€ concept-save.js        Concept block save function
β”‚   β”œβ”€β”€ concept-svg.js         Static N/L/V/H SVG as a React component
β”‚   β”œβ”€β”€ frontend.css           Shared styles (frontend + editor canvas)
β”‚   └── editor.css             Editor-only overrides
└── build/                     Pre-built; included in zip
    β”œβ”€β”€ index.js               Editor bundle (~31 KB)
    β”œβ”€β”€ view.js                Frontend bundle (~10 KB)
    β”œβ”€β”€ frontend.css           Shared styles
    β”œβ”€β”€ frontend-rtl.css       RTL variant
    β”œβ”€β”€ editor.css             Editor-only styles
    └── *.asset.php            WordPress dependency manifests

Adding a new preset

  1. Export the diagram data object from src/diagrams.js and add it to PRESETS.
  2. Add a registerBlockVariation call in src/index.js.
  3. npm run build.

Using the renderer standalone

src/renderer.js has zero WordPress or React dependencies:

import { renderDiagram } from './renderer';
renderDiagram( svgElement, { nodes: [...], connections: [...] } );

Requirements

  • WordPress 6.3+
  • PHP 8.0+
  • Node.js 20+ (development only)

Releases

1 release. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
v1.0.0 latest
Apr 26, 2026 5mo ago
blender-node-diagram.zip
7