GSoC Project: Web-based UI integration with BlenderBIM
Introduction
Hi everyone! My name is Ziad Ibrahim, and I'm a fourth-year CS student at Cairo University, Egypt. I'm happy to participate in GSoC as a contributor this year and work on the Web-based UI integration with Blender project.
Project goal
The goal of my project is to have a web interface running alongside Blender. This web interface ideally shows tabular data for objects that Blender knows about, has real-time updates, and executes operators on them.
I'll use this thread to update you on my progress throughout GSoC. I am looking forward to engaging with the community.
Please feel free to ask any questions you might have, or if you have any additional ideas.
Comments
Hello!
Sorry for the absence, as I had my exams from May 25th to today (June 6th), so not much work was done during the previous period.
Plan
Blender UI
So currently, the plan is to have a button somewhere on the UI, that once clicked would open the web browser and establish a WebSocket connection to allow for real-time data display.
For now, the button will be in the

Quality and Collaboration
tab beside the header of theSpreadsheet import/export
panel.(that's the best-looking "globe" icon I could find)
I would love to hear your feedback on where the button should be.
Implementation
Once the operator is clicked from Blender, it will start a WebSocket server on another thread so it doesn't block the main Blender UI thread.
NOTE: This can also be easily refactored to make the WebSocket server standalone and blender acts as a client connects to it instead of having serverside code.
once the WebSocket server is opened, a web browser will automatically be opened using the
webbrowser
Python module. This allows the user not to worry about opening the web browser themselves.The browser instance will either serve an HTML file or open it on the local host URL and port specified.
once the web UI is opened, it will connect to the WebSocket server using JavaScript. So we will be able to listen to any messages from the WebSocket server using
on message
listeners, and we will be able to send messages to the WebSocket server on user interaction with the web UI, such as when a user selects a row in the displayed tabular data, etc.And that is the general plan for the web UI. I would like to know if anyone has any feedback, suggestions, or questions about the process.
Hi Ziad, I hope your exams went well. The technical scope and solution look good. For the button, I'd prefer a button with a descriptive text label, as remembering what another icon is for is a hassle for my old brain (as a very occasional user, Inkscape is a real challenge as it uses an icon based UI). I appreciate I'm probably in a tiny minority about this. Looking forward to trying your system.
Agreed @John - I think having it as one of those in the list there would would well for a start, ie:
I'm excited for the potential of this work though - I can see the ability to have a browser window connection to Blender to be quite powerful - especially where we're limited by the customizability of the Blender UI.
@John That's a valid concern, I'll keep that in mind.
thanks for your feedback
Very cool! Can you use the "URL" icon? That would be consistent with all the other places we refer to a webbrowser clickable link in the UI.
Oh yes, that looks much better than the one I have!
Hi Ziad, great to see your progress and plans for the Web-based UI integration with Blender project! I've done a similar POC for FreeCAD and understand the challenge pretty well.
I think you should focus primarily on developing the server solution, WebSocket API, and web client rather than modifying the Blender UI at this stage.
For the Blender integration, I recommend using this addon as a starting point: https://github.com/KoltesDigital/websocket-server-for-blender. It automatically starts a WebSocket server and uses bpy.context to interface with Blender. The addon may need some updates as it's 9 years old, or just use it as inspiration.
To create an inspiring and useful demo quickly, I suggest implementing the ability to:
This flow would leverage the WebSocket technology nicely. Here are the key steps:
For bonus points, you could build a simple backend server with authentication. It would maintain a single session connecting your web client and local Blender instance. This would allow you to stream your Blender edits in real-time and collaborate with others.
Taking this further, there is exciting potential with features like:
Implementing these capabilities would elevate the project from a tech demo to a truly powerful tool enabling seamless import/export, live preview, backup, and multi-user editing of BIM models via a web interface and a desktop BlenderBIM.
Let me know if you need any help. Excited to see what you will build.
I've just realised that the code should be a part of the BlenderBIM addon. Frankly, I don't think it is feasible that the pull request will be accepted. Much easier to make it a separate addon and merge it in once it matures. The challenge is the server lifecycle management which isn't properly described. For a POC, import/export of IFC files would be enough rather than replicating the BlenderBIM Gantt chart UI, IMHO.
A huge thanks for your feedback and interest!
For loading / saving to the cloud, I would say that this is something more appropriate for OpenCDE - it has a workflow intended for loading and saving to collaboration servers.
In contrast, the purpose here is to provide a supplementary interface to the Blender UI where Blender's UI has limitation. For example, unlike FreeCAD, Blender has its own strict UI toolkit rules. It cannot (easily) have grids of images, cannot show gantt charts, cannot show spreadsheet / tabular data easily, cannot show embedded drawing views, cannot show even things like textareas. So this would work alongside the Blender session on specific domains.
And yes, @Ziad is using websockets - he can explain in more detail how the implementation works. The focus is on the server connection.
I would say user auth is also the domain of OpenCDE. Similarly, you might be interested in IFC Git - which has Git integration which allows versioning, collaboration, and conflict resolution. This works on any native IFC platform, so you can even use it with FreeCAD's new Native IFC workbench.
I'm hoping to have an unstable release in about a week with the code merged in so people can see an initial test. After that, the first goal is integration with the IfcCSV tool to interactively work with spreadsheets alongside the model.
Hello, @vanuan! First of all, thanks very much for the great message.
Yes, that addon was helpful as a starting point. it helped me learn how to start a WebSocket server in Blender using threads.
Great suggestion. However, the purpose is to display the IFC file objects in a tabular format on the web UI (think of Excel after exporting a CSV in BBIM), and later on, be able to run operations on them.
The steps are quite similar to those you suggested:
Later on, we can support operations from the web UI by doing something similar:
A big challenge in the described approach is the server management (starting, closing, connecting, listening, and sending data to the server) using Blender.
The way it is currently done is by:
I hope my explanation made sense!
I think it isn't tough to integrate with BlenderBIM due to the way BlenderBIM is organized (module/core/tool) which makes it easy to extend and use the current functionality.
Not really, as the server will be local, so there won't be server lifecycle management concerns beyond basic setup.
Sure, will do.. Thanks for the feedback!
Thanks for pointing out the limitations of Blender's UI toolkit. I hadn't considered the constraints that made opening drawings in the browser a necessity rather than just a design choice.
While a web-based UI can certainly complement Blender for specific BIM tasks, I wonder if a separate browser window might feel a bit disconnected from desktop app. Have you considered an Electron-based approach to create a more native-feeling experience? Though packaging another platform-dependent app inside a blender extension could be technically much more challenging than just a python server.
Still, focusing on a specific use case like layouting drawings (essentially displaying grids of images) rather than just a technical capability could be more impressive. Interactive spreadsheet editing with the IfcCSV integration and reimplementing gantt charts seem interesting as well, but a bit more complex.
Looking forward to testing the initial version. Keep up the great work!
Hello everyone!
It's been a while since our last update. The web UI is now ready for testing, and we would love your feedback!
In this comment, I'll explain how to use the web UI. In the next comment, I'll go into the technical details with diagrams for those interested.
Starting and Connecting to the Web UI
The web UI can be found under the Quality and Coordination tab.
To start the web UI, enter a port number in the
WebSocket Server Port
field, then click theConnect/Start Websocket Server
button. You can also keep the default value0
, and Blender will automatically assign a free port number.Multiple BlenderBIM instances can connect to the same web UI by specifying the same port number in all of them.
Once started, you can:
Web UI Components
After starting the web UI, a browser tab will open.
The web UI includes:
There are three pages in the web UI:
Note: Page names might be updated to reflect their functionalities better.
IFC Data Page
The IFC data page shows tabular data for the exported IFC data. This IFC data is exported from the Spreadsheet Import/Export Panel in BlenderBIM
To export data to the web UI:
1. Go to the Spreadsheet Import/Export Panel.
2. Select the web UI output format.
3. Specify the search group and CSV attribute.
4. Click on
Export IFC to WEB
.Note: If the BlenderBIM instance is not connected to a web UI, pressing
Export IFC to WEB
will start the web UI and export the data.If multiple instances of the BlenderBIM export data then there will be multiple tables in the web UI.
The table in the web UI allows you to:
Note: If the global ID is not included while exporting data, highlighting will not be available.
If data changes in BlenderBIM, re-export it to update the web UI.
Gantt Chart Page
The Gantt chart page shows the work schedules Gantt charts. Once you have set up a work schedule gantt chart and connected to a web UI then press Generate Gantt to display it in the web UI.
To display a Gantt chart:
1. Set up a work schedule in BlenderBIM.
2. Connect to the web UI.
3. Click
Generate Gantt
.Once the Gantt chart is generated, you will see the Gantt chart in the web UI.
You can edit task names and start/end dates directly in the web UI. Updates will be reflected in both the web UI and BlenderBIM.
Note: If tasks are updated in BlenderBIM, re-generate the Gantt chart to refresh the Gantt chart on the web UI.
If multiple instances of the BB generate Gantt charts then there will be multiple Gantt charts in the web UI.
Drawings Page
The drawings page shows the drawings and sheets that you have created. Once the page is opened, it will show a dropdown menu of the IFC files, from which you can select a specific IFC file to view the drawings and sheets.
Once a file is selected, the side panels will show the drawings and sheets from which you can select one to view it in the web UI.
Note: To refresh the drawings/sheets shown, refresh the page. This functionality is currently being improved.
That covers the current functionalities of the web UI. I'd like for everyone to help in testing it and give any feedback!
In the next comment, I'll explain the technical aspects with diagrams.
For everyone interested in how the web UI works, here are several diagrams that should explain the general concepts. If anyone has any questions or feedback, please do not hesitate to let me know!
First Diagram
This diagram shows how the web UI WebSocket server starts/connects and the relationship between a BlenderBIM instance, a WebSocket server, and the web UI itself.
Once a user clicks on the
Connect/Start Websocket Server
button, the operatorconnect_websocket_server
is executed. This operator passes the specified port and the Web tool (tool/web.py) to the Web core (core/web.py)connect_websocket_server
function.The Web core does the following:
start_websocket_server
function from the Web tool. If the port is not available, then there is a server running on that port, and it skips starting the server.The
start_websocket_server
function starts the server (sioserver.py) as a subprocess on the specified port.connect_websocket_server
function from the Web tool to connect to the web UI WebSocket server.There can be multiple BlenderBIM instances connected to the same web UI WebSocket server. However, only the instance that started the server can kill it.
There can also be multiple servers, provided they are started from BlenderBIM instances that are not connected to any server and the port is not used by any other server.
Second Diagram
This diagram shows the data flow between a BlenderBIM instance and the web UI.
Both the IFC Data page and the Gantt Chart page have similar data flows. However, the Drawings page has a different data flow.
IFC Data and Gantt Chart Pages Data Flow
Once the user clicks
Export IFC to WEB
orGenerate Gantt Chart
in BlenderBIM, the data is fetched from their respective places (IFCCSV for the CSV data, and Sequence Tool for the Gantt data).The function
send_webui_data
from the Web Tool is called with the following arguments:The
send_webui_data
function loads the WebData if it is not already loaded. The WebData contains the IFC file name and a "is dirty" flag indicating whether there have been changes in BlenderBIM that are not reflected in the web UI.Then, the data is emitted to the server with the specified event name. The server forwards the data to the web UI along with the Socket ID for that specific BlenderBIM instance.
The Socket ID is a unique ID given to each client connected to the WebSocket server. This ID is used for updating the BlenderBIM instance data on the web UI.
Finally, once the data arrives at the web UI, it is rendered and displayed.
If any operations are performed on the web UI, such as:
The web UI emits a
web_operator
event with the details of the operator, such as Blender socket ID, page, operator type, etc. This data is received by the server and forwarded to the BlenderBIM web tool, specifically thesio_listen_web_operator
function, to be passed to each page's operator handlers, which will map web operations into IFC/Blender operators.Drawings Page Data Flow
The Drawings page has a different flow. It starts when the Drawings page is opened, emitting a
web_operator
event with the operator type beinggetDrawings
.This operator is handled by the
handle_drawings_operator
function in the Web Tool. It retrieves the drawings data from the Drawing Tool (tool/drawing.py) and sends it to the server with the eventdrawings_data
, which sends it back to the web UI to be displayed.Nicely done! This is awesome, of course! :)
...
This is probably in the roadmap anyway, but for sheets, it would be awesome (and it seems a low hanging fruit) to use the webUI to move drawings around on the canvas.
Would replace having to rely on Inkscape to compose sheets.
Also would be awesome to integrate a real-time whiteboarding tool like tldraw or FirstDraft to be able to markup sheets that could be shared with collaborators.
fyi, tldraw used to be open source, by they changed their license to a more proprietary license back in December. Could be still a worthy fork, however, at that point.