Skip to content

Exporting GLB and Importing into the Twin Host

Companion videos

Watch on YouTube (opens in a new tab)

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 →


By the end of this lesson you should be able to:

  1. Export the model in glTF/GLB form (with FBX/OBJ as alternatives), ready to use with the Twin
  2. Bring the model into TESA Digital Twin through the course’s main host (Bitstream Studio)
  3. Define interaction points, sensor points, and mounting positions
  4. 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.

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

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


Follow this order every time, before pressing Export.

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

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

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

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

  1. Select only the parts to send (or send the whole scene, per the team’s agreement)
  2. File → Export → glTF 2.0
  3. Format: glTF Binary (.glb)
  4. 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
  1. 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
  1. Name the file, for example enclosure_twin.glb, then Export
  2. 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)”
  1. Install/open Bitstream Studio from VS Code
  2. Open your workspace (review the host approach from Course 2 if you have taken it)
  3. Import the .glb file 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.

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.


The goal of this section: get the design team and the firmware team speaking the same language.

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).

sensor_bmi270_slot
sensor_sht40_vent
interact_lid
interact_user_button
led_status_window

Record each name ↔ its meaning in the checklist — don’t use a random name.

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.


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):

  1. Serve the web-app/ folder from TESAIoT_Hackathon
  2. Open ex05 (orientation) or ex06 (dashboard), depending on the sensors you have
  3. 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).

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.


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

  1. Do the lab: Lab
  2. Fill in export-twin-checklist.md
  3. When ready, continue to M05 — Scenario and Digital Validation

  1. glTF 2.0 importer/exporter (4.5 LTS)
  2. glTF Animations
  3. glTF Materials
  4. Apply Scale
  5. Khronos glTF
  6. Blender Fundamentals — Importing & Exporting
  1. Bitstream Studio
  2. ternion-3d-assets-free
  3. TESAIoT_Hackathon — web-app/ex05, ex06
  4. TESAIoT Developer Hub
  5. Course 2 M03 · Course 2 M04 · Course 3 TOC

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.

  1. ถ้าต้องการให้ผลของ Boolean / Solidify / Bevel ที่ยังไม่ Apply ในฉากติดไปใน GLB ต้องเปิดตัวเลือกใด (Objective 1)

    1. Selected Objects
    2. Animations
    3. Materials
    4. Data → Mesh → Apply Modifiers
    Show answer

    Answer: D. Data → Mesh → Apply Modifiers

    ตาราง Export option ในหัวข้อ 3

  2. ถ้านำเข้า Twin แล้วพบว่าสเกลผิด บทเรียนแนะนำให้ทำอย่างไร (Objective 2)

    1. ลบคลิปแอนิเมชันออก
    2. กลับไปแก้ใน Blender แล้ว export ใหม่
    3. ซูมแก้ใน Twin แล้วใช้ต่อถาวร
    4. เปลี่ยนไปส่ง STL แทน
    Show answer

    Answer: B. กลับไปแก้ใน Blender แล้ว export ใหม่

    หัวข้อ 4.2 First checks after import

  3. ชื่อใดตรงกับรูปแบบการตั้งชื่อจุดของบทเรียน (Objective 3)

    1. `Point1`
    2. `จุดเซ็นเซอร์`
    3. `Cube.001`
    4. `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

Lesson link: https://tesaiot.github.io/tesa-qualification-program/en/courses/product-design/m04-blender-to-twin/l01-blender-to-twin/

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.

Full guide: how to cite TESA

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