Skip to content

ZanePearton/blendx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlendX

A real-time vertex streaming system that allows you to view and monitor Blender mesh deformations in a web browser. Perfect for visualizing vertex-level changes, mesh deformations, and live sculpting sessions.

Features

  • Real-time vertex streaming - See mesh deformations as they happen in Blender
  • Web-based viewer - No additional software needed, runs in any modern browser
  • Multiple client support - Multiple browsers can connect simultaneously
  • Live mesh updates - Captures vertex movements, not just object transforms
  • WebSocket communication - Low-latency streaming at 10 FPS

Use Cases

  • Sculpting visualization - Monitor sculpting progress in real-time
  • Animation preview - Preview mesh deformations during rigging/animation
  • Collaborative work - Share live Blender sessions with team members
  • Educational demos - Show mesh topology changes to students
  • Quality assurance - Monitor mesh integrity during complex operations

Installation

Blender Addon

  1. Download blendx_addon.py
  2. In Blender: Edit → Preferences → Add-ons → Install...
  3. Select the downloaded Python file
  4. Enable "BlendX" in the add-ons list

Web Client

  1. Download all web files: index.html, styles.css, app.js
  2. Keep all files in the same folder
  3. Open index.html in any modern web browser
  4. No additional setup required

Usage

Starting the Stream

  1. In Blender:

    • Open the 3D Viewport sidebar (N key)
    • Navigate to the "Stream" tab
    • Click "Start Vertex Stream"
    • Confirm the server starts on localhost:8765
  2. In Browser:

    • Open index.html in your browser
    • Click "Connect"
    • Status should show "Connected"

Viewing Live Changes

  • Create or select mesh objects in Blender
  • Enter Edit Mode (Tab)
  • Move, scale, or deform vertices
  • Changes appear instantly in the browser
  • Browser shows all visible mesh objects with random colors

Project Structure

BlendX/
├── blendx_addon.py      # Blender addon for vertex streaming
├── index.html           # Main web application
├── styles.css           # Application styling
├── app.js              # Three.js rendering and WebSocket logic
└── README.md           # This file

Data Format

The addon streams JSON data containing:

{
  "objects": [
    {
      "name": "Cube",
      "vertices": [[x, y, z], [x, y, z], ...],
      "faces": [[0, 1, 2, 3], [4, 5, 6, 7], ...],
      "vertex_count": 8
    }
  ]
}

Coordinate System

  • Blender: Z-up coordinate system
  • Three.js: Y-up coordinate system
  • Automatic conversion: (x, z, -y)

Performance

  • Streaming rate: 10 FPS (100ms intervals)
  • Data: Vertex positions and face topology
  • Bandwidth: Varies with mesh complexity
  • Latency: ~100-200ms typical

Web Client Components

  • index.html: Main application structure and Three.js integration
  • styles.css: UI styling with dark theme and responsive controls
  • app.js: WebSocket handling, 3D scene management, and vertex processing

Debugging

Browser Console

Open developer tools (F12) to see:

  • Connection status messages
  • Received data logging
  • Vertex/face count information
  • Error messages

Blender Console

Check Blender's system console for:

  • Object processing messages
  • Client connection/disconnection
  • Streaming errors

Common Issues

"Nothing appears in browser"

  • Check if Blender has visible mesh objects
  • Verify WebSocket connection (green "Connected" status)
  • Look for console error messages

"Still seeing box shape after vertex changes"

  • Ensure you're in Edit Mode when moving vertices
  • Check that streaming is active (not paused)
  • Verify objects aren't instanced or linked

"Connection failed"

  • Confirm Blender addon is running
  • Check firewall settings for localhost:8765
  • Try restarting both Blender and browser

Requirements

Blender

  • Blender 4.0+ (may work with 3.6+)
  • Python libraries: ws4py, wsgiref (included with Blender)

Browser

  • Modern browser with WebSocket support
  • WebGL support (for Three.js)
  • JavaScript enabled

API Reference

Blender Addon Classes

  • StreamSocket: WebSocket handler for client connections
  • STREAM_OT_start: Operator to start streaming server
  • STREAM_OT_stop: Operator to stop streaming server
  • STREAM_PT_panel: UI panel in 3D viewport sidebar

Key Functions

  • stream_scene_data(): Main streaming loop, gathers and sends vertex data
  • connect(): JavaScript function to establish WebSocket connection
  • updateScene(): JavaScript function to update Three.js geometry

Development Setup

git clone https://github.com/yourusername/blendx.git
cd blendx

No build process required - direct Python and HTML files.

License

MIT License - see LICENSE file for details.

Acknowledgments

  • Built with Three.js for 3D rendering
  • Uses ws4py for WebSocket communication
  • Inspired by the need for real-time Blender visualization

Changelog

v1.0.0

  • Initial release
  • Real-time vertex streaming
  • Multi-client support
  • Web-based Three.js viewer

About

A real-time vertex streaming system that allows you to view and monitor Blender mesh deformations in a web browser. Perfect for visualizing vertex-level changes, mesh deformations, and live sculpting sessions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors