Exporting GLB and Importing into the Twin Host
Companion videos
Watch on YouTube (opens in a new tab)
-
BS-01: Introduction to Bitstream Studio Asst. Prof. Dr. Santi Nuratch (KMUTT) -
BS-11: 3D Object Transform Drivers Asst. Prof. Dr. Santi Nuratch (KMUTT) -
BS-13: Graphics Settings Asst. Prof. Dr. Santi Nuratch (KMUTT) -
BS-14: Animation Player Asst. Prof. Dr. Santi Nuratch (KMUTT) -
BS-15: Animation Clips & Mixers Asst. Prof. Dr. Santi Nuratch (KMUTT)
Videos by Asst. Prof. Dr. Santi Nuratch, Department of Control Systems and Instrumentation Engineering, Faculty of Engineering, King Mongkut's University of Technology Thonburi (KMUTT) · The whole series in the playlist AIoT Foundation
Course 3 · Module 4 Suggested time: about 3 hours — export GLB from Blender, import into a Twin host, define sensor/interaction points, then test against telemetry or an animation clip Format: a hands-on lesson — read it and follow along directly; full usage-scenario simulation is in M05
Lab · Export checklist · ← Table of Contents · ← M03 · M05 →
Objectives (Learning Outcomes)
Section titled “Objectives (Learning Outcomes)”By the end of this lesson you should be able to:
- Export the model in glTF/GLB form (with FBX/OBJ as alternatives), ready to use with the Twin
- Bring the model into TESA Digital Twin through the course’s main host (Bitstream Studio)
- Define interaction points, sensor points, and mounting positions
- Test the model together with telemetry / motion / sensor value data
Key phrase A good GLB = correct size · correct axes · clear clip names · exportable materials — import into the Twin, then dress the scene; don’t fix the scale a hundred times over afterward.
Read alongside this chapter
Section titled “Read alongside this chapter”| Document | Use when |
|---|---|
| M03 — Motion and Interaction | The lid_open clip / the clip list |
| Course 2 M03 — Blender for Twin | A short overview of exporting GLB |
| glTF 2.0 exporter (Blender 4.5) | Mesh / Materials / Animations options |
| glTF Animations | Stashing Actions · clip names |
| glTF Materials | Principled BSDF that exports correctly |
| Apply Scale | Before exporting |
| Khronos glTF | The file standard the Twin / the web uses |
| Bitstream Studio (Marketplace) | Importing / displaying a 3D model + telemetry |
| ternion-3d-assets-free | Sample GLB files, for reference on scale and materials |
| TESAIoT_Hackathon | web-app/, e.g. ex05 for comparing sensor data |
| TESAIoT Developer Hub | Board reference when pairing sensor points |
| Export checklist | The deliverables form |
1. What “Twin-ready” Means Here
Section titled “1. What “Twin-ready” Means Here”In Course 3, the main Digital Twin host is Bitstream Studio (a VS Code extension) — it accepts glTF Binary (.glb) files for preview / Sensor Studio / Animation Lab, depending on the tools available.
[Blender .blend] export glTF 2.0 │ ▼ enclosure_twin.glb │ ▼[Bitstream Studio / Twin host] place model · mark sensor/interaction · play clip │ ├── optional: live telemetry (Simulator or Board) └── optional: Hackathon web-app ex05 / ex06 as second screen| Format | Use when |
|---|---|
.glb |
The main target — a single file combining mesh + materials + animations |
.gltf + bins/textures |
When you need to keep textures separate for external editing |
| FBX / OBJ | A backup route for other tools — not the web Twin’s main path |
| STL | Kept for printing in M06 — does not replace GLB for the Twin |
Standard: Khronos glTF
2. Prepare the Blend File Before Export
Section titled “2. Prepare the Blend File Before Export”Follow this order every time, before pressing Export.
2.1 Scale, origin, and cleanup
Section titled “2.1 Scale, origin, and cleanup”| Step | Action | Why |
|---|---|---|
| 1 | Check the team’s units still match M01 (Metric + mm + the agreed Unit Scale) | Prevents scale problems in the Twin |
| 2 | Ctrl+A → Scale (and Rotation if needed) on the parts you will send |
Apply |
| 3 | The lid’s Origin is at the hinge (from M03) | The clip rotates around the right point |
| 4 | Delete/hide cutters, test lights, and cameras you don’t want to send | A lighter, tidier file |
| 5 | Objects have short English names | So they can be referenced in the Twin / the checklist |
2.2 Materials that survive export
Section titled “2.2 Materials that survive export”Use Principled BSDF, as practised in M02 — glTF supports its main parameters well (glTF Materials)
| Do | Avoid for Twin export |
|---|---|
| Clear Base Color / Roughness / Metallic | Complex shaders glTF does not understand |
| Enough UV for any important pattern (if using a texture) | Relying only on procedural nodes that cannot be baked |
| Test in Material Preview before exporting | Assuming EEVEE and the Twin look exactly the same |
2.3 Animations that will be included
Section titled “2.3 Animations that will be included”Per glTF Animations:
- An Action is exported if it is the active action, or has been stashed into an NLA track
- If there are several clips (
lid_open,lid_close), stash them all before exporting - Track/action names affect the clip names in the GLB — use the same names as in the clip list
2.4 Optional: reduce polycount
Section titled “2.4 Optional: reduce polycount”If the file is large or the Twin stutters:
- Reduce unnecessary subdivision
- Don’t reduce it so much the port openings become unreadable
- Compare the file size with the examples in ternion-3d-assets-free as a rough guide
3. Export glTF Binary (.glb) — Step by Step
Section titled “3. Export glTF Binary (.glb) — Step by Step”Full reference: glTF 2.0
- Select only the parts to send (or send the whole scene, per the team’s agreement)
File → Export → glTF 2.0- Format: glTF Binary (.glb)
- Recommended options to turn on at minimum:
| Export option | Lab tip |
|---|---|
| Selected Objects (if you selected parts) | Prevents lights/test planes going along with it |
| Data → Mesh → Apply Modifiers | Sends the result of any Boolean/Solidify/Bevel not yet applied in the scene |
| Materials | Includes the Principled setup |
| Animations (if there is a M03 clip) | Turn it on and check the Mode below |
- Animation Mode (when there are several clips):
| Mode | Use when |
|---|---|
| Actions (default) | There is an active action, or one already stashed in the NLA |
| NLA Tracks | Managing several tracks as clearly separate clips |
- Name the file, for example
enclosure_twin.glb, then Export - Check the file size and open it in your system’s preview tool (or temporarily import it back into Blender) to confirm the clips still play
Record the options actually used in export-twin-checklist.md
4. Import into Bitstream Studio (Twin Host)
Section titled “4. Import into Bitstream Studio (Twin Host)”4.1 Bring-up
Section titled “4.1 Bring-up”- Install/open Bitstream Studio from VS Code
- Open your workspace (review the host approach from Course 2 if you have taken it)
- Import the
.glbfile per that round’s UI, for example- The Assets / Model / Free Loader panel
- Or Sensor Studio / 3D preview / Animation Lab
Button details may differ by version — follow the manual for the version you’re using, and note the panel name used in the checklist.
4.2 First checks after import
Section titled “4.2 First checks after import”| Check | Pass means |
|---|---|
| Model visible | The box is visible in the viewport |
| Scale usable | Not abnormally tiny/gigantic compared with the real thing or the PCB you have in mind |
| Up-axis / orientation | It can sit on the “floor” without a long corrective rotation |
| Named parts readable | The lid/base can be told apart if the Twin shows a hierarchy |
| Animation (if exported) | lid_open plays, or a clip list is present |
If the scale is badly wrong: go back and fix it in Blender, then export again — don’t just zoom to compensate in the Twin and call it done (that is acceptable only as a temporary workaround).
4.3 Compare with a known-good GLB (optional)
Section titled “4.3 Compare with a known-good GLB (optional)”Load a model from ternion-3d-assets-free alongside it, to confirm your machine’s import pipeline works — then switch back to your own model.
5. Interaction Points and Sensor Nodes
Section titled “5. Interaction Points and Sensor Nodes”The goal of this section: get the design team and the firmware team speaking the same language.
5.1 What to mark
Section titled “5.1 What to mark”| Point type | Example on your enclosure | Link to firmware / Twin |
|---|---|---|
| Sensor node | The opening above the IMU / temperature sensor | Sensor name, e.g. bmi270, sht40 |
| Interaction point | The lid · a button · an LED window | The lid_open clip · an LED state |
| Mount / placement | The base that sits on a desk · screw holes | The origin used for placement in the scene |
In the lab, name at least 1 point clearly enough to explain (its position on the model + a name tied to data).
5.2 Naming convention (lab)
Section titled “5.2 Naming convention (lab)”sensor_bmi270_slotsensor_sht40_ventinteract_lidinteract_user_buttonled_status_windowRecord each name ↔ its meaning in the checklist — don’t use a random name.
5.3 How you “define” them in the lab
Section titled “5.3 How you “define” them in the lab”Depending on the tools available, any one of these counts:
- An Empty / locator in Blender that gets exported along with the model
- A position note + a screenshot in the Twin
- Binding an animation clip or material to a state in the UI
What matters is having evidence and a consistent name, not just pointing at the air during a presentation.
6. Test with Telemetry or Motion Data
Section titled “6. Test with Telemetry or Motion Data”6.1 Minimum test matrix
Section titled “6.1 Minimum test matrix”| Test | How | Pass |
|---|---|---|
| A — Static placement | The model sits still in the Twin | Size/axes are usable |
| B — Clip playback | Play lid_open in the host |
The lid opens as designed |
| C — Live or sim data (recommended) | Link a Simulator or Board + watch telemetry | Sensor values flow while the model is on screen |
6.2 Suggested second screen — Hackathon web-app
Section titled “6.2 Suggested second screen — Hackathon web-app”Once the model is in the Twin (this does not replace the export step):
- Serve the
web-app/folder from TESAIoT_Hackathon - Open ex05 (orientation) or ex06 (dashboard), depending on the sensors you have
- Capture both: the Twin with the model + the web-app with the values
Use this to teach that a 3D model is a visual shell — the sensor’s truth lives in the data stream (Course 2 M04 has an ex05 walkthrough).
6.3 Example bindings (pick one)
Section titled “6.3 Example bindings (pick one)”| If you have… | Binding idea |
|---|---|
| A BMI270 stream | Rotate/tilt the preview per orientation (if the host supports it), or compare against ex05 |
| A threshold / mode event | Change the colour of the led_status_window part, or play a short clip |
| Lid interaction in the UI | A button in the Twin that triggers lid_open |
You don’t need to complete every item in 3 hours — choose at least one path with evidence.
7. Quality Gate Before M05
Section titled “7. Quality Gate Before M05”| Check | Pass means |
|---|---|
A .glb file exists |
Its name and location are recorded in the checklist |
| Import OK in Bitstream Studio | A screenshot |
| Scale / axis usable | No need to re-guess the scale |
| ≥ 1 sensor or interaction point documented | Name + position |
| Clip names match the M03 list (if any) | No renaming during export without recording it |
| Optional telemetry evidence | From the Studio and/or the web-app |
Next Steps
Section titled “Next Steps”- Do the lab: Lab
- Fill in export-twin-checklist.md
- When ready, continue to M05 — Scenario and Digital Validation
References and Further Reading
Section titled “References and Further Reading”Blender / glTF
Section titled “Blender / glTF”- glTF 2.0 importer/exporter (4.5 LTS)
- glTF Animations
- glTF Materials
- Apply Scale
- Khronos glTF
- Blender Fundamentals — Importing & Exporting
Twin host and evidence
Section titled “Twin host and evidence”- Bitstream Studio
- ternion-3d-assets-free
- TESAIoT_Hackathon —
web-app/ex05,ex06 - TESAIoT Developer Hub
- Course 2 M03 · Course 2 M04 · Course 3 TOC
Check your understanding
Section titled “Check your understanding”Three short questions in quiz.yaml, one per objective of this lesson. Try answering them yourself first, then compare with the answer key and explanations in the file.
Continue hands-on at Lab: export GLB and import into the Twin
Lab · Export checklist · ← TOC · ← M03 · M05 →
Review questions
Answer on your own first, then open the answer.
-
ถ้าต้องการให้ผลของ Boolean / Solidify / Bevel ที่ยังไม่ Apply ในฉากติดไปใน GLB ต้องเปิดตัวเลือกใด (Objective 1)
- Selected Objects
- Animations
- Materials
- Data → Mesh → Apply Modifiers
Show answer
Answer: D. Data → Mesh → Apply Modifiers
ตาราง Export option ในหัวข้อ 3
-
ถ้านำเข้า Twin แล้วพบว่าสเกลผิด บทเรียนแนะนำให้ทำอย่างไร (Objective 2)
- ลบคลิปแอนิเมชันออก
- กลับไปแก้ใน Blender แล้ว export ใหม่
- ซูมแก้ใน Twin แล้วใช้ต่อถาวร
- เปลี่ยนไปส่ง STL แทน
Show answer
Answer: B. กลับไปแก้ใน Blender แล้ว export ใหม่
หัวข้อ 4.2 First checks after import
-
ชื่อใดตรงกับรูปแบบการตั้งชื่อจุดของบทเรียน (Objective 3)
- `Point1`
- `จุดเซ็นเซอร์`
- `Cube.001`
- `sensor_sht40_vent`
Show answer
Answer: D. `sensor_sht40_vent`
หัวข้อ 5.2 Naming convention: `sensor_…`, `interact_…`, `led_status_window`
Cite this lesson
If you teach from this lesson or reuse it in slides or documents, credit it with the text below. If you changed it, add (adapted) after the title.
"Exporting GLB and Importing into the Twin Host" from TESA Open Knowledge by the Thai Embedded Systems Association (TESA), https://github.com/tesaiot/tesa-qualification-program, licensed under CC BY-NC 4.0
Thai attribution: "ส่งออก GLB และนำเข้า Twin host" จาก TESA Open Knowledge โดยสมาคมสมองกลฝังตัวไทย (Thai Embedded Systems Association: TESA) https://github.com/tesaiot/tesa-qualification-program สัญญาอนุญาต CC BY-NC 4.0
This lesson adapts the source below; keep its credit too.
https://github.com/drsanti/TESAIoT-Courses/blob/287c21814ba8c75f693136616dcd270349a15966/C3/M04/README.md · Original content by Asst. Prof. Dr. Santi Nuratch (ผศ.ดร.สันติ นุราช), KMUTT. Course 3 (C3/) of drsanti/TESAIoT-Courses. TESA funded the work and holds the rights; published here under CC BY-NC 4.0. The upstream repository carries no licence file. Text kept faithful; structure, front matter, quizzes and notes added by TESA Open Knowledge.
TESA Open Knowledge · © 2026 สมาคมสมองกลฝังตัวไทย (TESA) · CC BY-NC 4.0
Content is licensed CC BY-NC 4.0. Reuse it non-commercially and credit the Thai Embedded Systems Association (TESA) every time. · How to cite TESA