Introduction

The blendixserial lets you connect Blender to external devices using serial communication. You can send and receive data in real time, control 3D objects, and display text from a connected device. The add-on allows you to set up a serial connection, adjust port settings, and choose different modes based on your needs. No matter what device you’re using—robots, sensors, or other hardware—blendixserial helps you easily connect and control it in Blender.

Features

  • Quick Serial Connection – Easily connect and disconnect external devices.
  • Real-Time Data Exchange – Send and receive data instantly between Blender and your device.
  • Control 3D Objects – Move and animate objects based on incoming serial data.
  •  Live Text Display – Show received text as 3D objects in Blender.
  • Scene Syncing – Update the Blender scene based on live data input.
  • User-Friendly Interface – Simple and intuitive panel inside the 3D Viewport.
  • Debugging – Monitor and troubleshoot communication using built-in debugging options.

At the heart of the add-on is the use of timers. By registering a function with bpy.app.timers, the add-on makes sure this function runs at regular intervals during the animation process. This gives you precise control over when and how your animations update, allowing for dynamic, automated changes without any manual effort.

This add-on uses Python’s threading and queue modules to manage several tasks at once and pass data smoothly between different parts of the add-on. By handling serial port reading in a separate thread, it keeps receiving data continuously while the Blender scene updates independently. Meanwhile, the queue ensures that each piece of data is processed in the order it was received, preventing any mix-ups or data loss.

Interface Overview

The blendixserial interface has two panels. One is for Serial Connection, and the other is for 3D Object Control. In the Serial Connection panel, you can select the port and baud rate from a drop-down menu, then use the Connect button to establish the connection. The Connection Status displays whether the add-on is currently “Disconnected” or “Connected.” This panel also has two icon buttons: one provides debugging options, and the other shows information about the add-on.

 The 3D Object Control panel includes a numerical field that lets you set how frequently the scene updates. By adjusting the delay value, you control how often the scene updates and how frequently the data’s visual representation changes in the Blender viewport. A smaller delay value produces more frequent updates and a smoother real-time visualization, while a larger delay value slows down updates and may make the visualization less responsive.

blendixserial interface
blendixserial interface

The panel includes a button that toggles movement updates on or off. The add-on offers three modes through a drop-down menu, allowing you to choose how you want to handle data: sending data from Blender, receiving data in Blender, or both. In send mode, there’s a field to specify how many frames to skip between sending keyframe data, and a button to add objects to the “Send” list for data transmission.

blendixserial interface - receive mode
blendixserial interface - receive mode

In Receive mode, the panel includes a field for displaying incoming text data directly in the 3D View. You can select a font text object to show any received data.

In addition, the panel includes an Animate Object section where you can add custom objects for animation based on incoming data. In this section, you control the movement of objects in the Blender scene by adjusting their position, rotation, and scale. You can choose which axes to apply movement to and customize properties such as location, rotation, and scale for each object.

3D Viewport Real-time VS Final Real-time

Real-time rendering lets you see and interact with your scene smoothly in the 3D viewport. It focuses on speed by using simpler graphics and lower-quality textures. This helps keep performance fast. Final rendering, on the other hand, creates high-quality images or videos with detailed lighting, shadows, and textures. It takes more time and processing power but gives a more realistic result.

The blendixserial addon uses a timer-based technique to animate objects within the scene. This technique involves registering a timer that calls a specific function repeatedly at regular intervals. In this case, a specific function is registered with bpy.app.timers to automate actions and updates in the scene. By utilizing timers, the addon can control the timing and frequency of object movements or other changes. 

In the viewport, you can adjust the update scene delay and optimize the scene to achieve a smooth real-time display. By reducing the update scene delay, you can increase the frequency at which the scene is updated, resulting in smoother motion and a closer representation of real-time. However, when it comes to final rendering for videos or images, achieving real-time rendering in the strictest sense, which means rendering an entire frame within the time it takes to display that frame, may not be possible. You can test this feature in the final real-time rendering process, and if you succeed, I would appreciate it if you could share your results with me as well.

Object Handling Capacity

The blendixserial add-on is designed to dynamically manage objects through custom collections, offering flexibility when working with different objects. There’s no hard cap on the number of objects the add-on can handle, its limits are really determined by your system’s performance and the speed of the serial communication

Note that I’ve only tested the add-on with 10 objects, so performance with larger numbers has not been fully explored.

Blender itself is capable of managing thousands of objects, but how well it performs depends on several factors. These include the power of your CPU and GPU, the complexity of the scene (like the number of polygons or animations), and how responsive the user interface is.

The speed of the serial communication is another key factor. Slower baud rates, like 9600-38400 bps, work fine for handling a smaller number of objects. But if you’re working with more objects and need faster updates, higher baud rates (115200+ bps) are the way to go.

Data Format

Receiving Coordinates

The blendixserial add-on is designed to receive data in a specific CSV format through a serial communication interface. The add-on expects the incoming data to be in the following CSV format:

x1, y1, z1, x2, y2, z2, x3, y3, z3; text data

Each set of coordinates (x, y, z) represents the position or rotation values for three different objects in a 3D scene. The coordinates values are separated by commas, and the entire coordinates data and text data are separated by a semicolon. When receiving data, the addon accepts both integer and float data types. This allows flexibility in handling different types of numerical values, ensuring accurate updates to object properties in Blender.

Transmitting Coordinates

When sending object data from Blender to a connected device, the addon follows the same CSV format as receiving but excludes the text data part. For receiving, only object values are processed, without any text data. The data sent consists of floating-point values, ensuring precise transmission of object properties such as position, rotation, and scale.

x1, y1, z1, x2, y2, z2, x3, y3, z3;

When sending or receiving data, the addon uses coordinate sets to represent object positions. Each object has three values for its position: X, Y, and Z. For example, the first object is (x1, y1, z1), the second object is (x2, y2, z2), the third object is (x3, y3, z3), and so on. This means you can send and receive data for multiple objects at the same time, with each set of values representing a different object’s position in the 3D scene.

What's New

In version 0.12 of blendixserial, you could only control three objects in Blender, and there was no way to send object animation data to a connected device. With the release of blendixserial 1.0, you can now both send and receive object data, and you can add multiple objects dynamically for sending or receiving. All other features remain the same as in the previous version.

Requirements

Blender version 4.2 

Installation

  • Open Blender and go to Edit -> Preferences.
  • In the Preferences window, click on the Get Extensions tab.
  • In Extension tab click the down arrow button at the top-right corner and select “install from disk”.
  • Browse and select the blendixserial zip file. The add-on is now installed and ready to use.

When you install the blendixserial add-on, you might run into an error that says “No module named ‘serial'”. This means that the ‘serial’ module, which is needed for serial communication, isn’t installed or accessible in your Blender environment.

blendixserial - serial module error

 Since Blender doesn’t come with the serial module pre-installed, you’ll need to install it manually. Here’s how to fix it:

  • Download the ‘serial’ module package from the Python Package Index (PyPI) website.
  • Once it’s downloaded, unzip the package and find the ‘serial’ folder.
  • Copy the ‘serial’ folder.
  • Go to your Blender installation directory, locate the “modules” folder, and paste the ‘serial’ folder there.
  • After that, enable the add-on again.

Now, you should be able to use blendixserial in Blender

License

This Addon is distributed under the terms of the GNU General Public License version 3 (GPLv3). You are free to redistribute and modify this program in compliance with the terms of the license. For more details, refer to the GNU General Public License page.

Download blendixserial Addon