Series Web3 Project 3D Modeling Voyage Training Log

~2 min read

Publishing the TINA Location Pin in Web 3D

The second Blender-to-web log: publishing a 3D location pin (POI) with a TINA logo token. This time the gates were extracting just the hero object from a sprawling working scene, and rescuing procedural material colors that glTF won't carry.

TrainingBlender3DThree.js

A Second Model

Time to put a second model on the 3D viewer built last time. It is a location pin (POI) marker with a TINA logo token set into its head. The pin that lands on a map was sculpted in 3D and given a one-turn animation over 40 frames.

3D 뷰어 로딩 중…

Gate 1 — Extracting the Hero from a Working Scene

The .blend held the whole workshop alongside the one finished piece. There were a hundred-odd objects. Seven pin-body variants, coin and token experiments, and purpose-built versions for vote, registration and complete were all scattered outside the camera frame. Export everything and the viewer's auto-framing pulls the camera back to fit it all.

The answer was selective export. I recursively selected just the hero pin's hierarchy (body → token → logo, five objects) and exported with use_selection=True. A 9.1MB working file became a 320KB web model.

def select_tree(o):
    o.select_set(True)
    for c in o.children:
        select_tree(c)
 
select_tree(bpy.data.objects["POI_TINA.002"])
bpy.ops.export_scene.gltf(filepath=out, use_selection=True, ...)

Gate 2 — Procedural Colors glTF Won't Carry

The first export came out all white. The materials here are procedural shaders built from noise and ramp nodes, and glTF doesn't understand node graphs. Any color that isn't an image texture simply gets dropped. Not even a baseColorFactor survives.

The orthodox fix is texture baking, but these colors are effectively flat per surface. So instead, I sampled representative colors from the render and injected them straight into the Principled BSDF sockets right before export.

FLAT = {
    "TINABlue":    ((0.010, 0.045, 0.380, 1.0), 0.85, 0.30),  # deep blue body
    "TINASKYBlue": ((0.080, 0.520, 0.950, 1.0), 0.60, 0.20),  # sky blue ring
    "TINAWhite":   ((0.900, 0.900, 0.900, 1.0), 0.00, 0.35),  # white coin
}
# cut the Base Color links, inject color/metallic/roughness as defaults

The material names carrying their colors (TINABlue, TINASKYBlue…) turned out to be an unexpected help. The name became the spec.

Studio Lighting This Time

The original scene is lit by six AREA lights. But glTF's lighting extension (KHR_lights_punctual) only knows point, spot and directional. Area lights don't survive at all. Unlike Geo DiPin last time, the scene lighting couldn't come along. So this model uses the viewer's studio mode (neutral white lighting) over a bright background to recreate the original's white product-shot mood. Environment reflections (envIntensity) finish the metal.

Addendum — Two V2 Variants

Two more variants, pulled from the V2 file of the same POI work. This time, instead of naming objects one by one, I generalized the script to auto-select only the meshes visible in the scene. Picking a variant in the working file meant toggling what's visible in the viewport, so one script now handles every file regardless of which objects are on. The color palette became a material-name dictionary too (TINAWhite, TINA.Yellow, TINA.CompleteBlue…). Any variant now gets its colors by name alone.

The vote pin is a white body with a yellow coin. It marks a place on the map where you can vote.

3D 뷰어 로딩 중…

The complete pin keeps the same body with a blue coin. A check symbol marks a completed location.

3D 뷰어 로딩 중…

Wrap-up

Key point

The pipeline is the same as last time. Last time the question was how to revive the lights, the glass and the glow. This time it was what to export and where the colors come from. Selective export picked only the meshes needed, and the colors came from render samples and material names. Every model brings a different problem, but the viewer built as a component gets reused as is. Once again, the post itself needed just one tag.