LLearnCode
Academy/graphics/The asset pipeline

advanced · 32 minute study

Treat the asset export as a build

The editable Blender scene is a source project. The browser consumes an exported artifact. A reliable pipeline checks the contract at that boundary instead of trusting an attractive authoring screenshot.

Loading progressEvidence grows with practice
Useful preparation · 1 prerequisite

Use this as a map, not a lock. If these ideas are familiar, continue.

  • Loading a model is an asynchronous lifecycle — A valid model can still arrive after the user leaves, point at missing textures, appear outside the camera, or leak GPU resources when revisited. Loading needs a state and ownership contract.

First, build a mental model

Blender to browser resembles source code to application: author, prepare, export, validate, load and inspect. The exported asset must preserve the intended scale, orientation, origin, material roles, animation and performance budget. Each stage can introduce a defect that the previous stage could not reveal.

  1. Agree on units, up direction, forward direction and origin before exporting. A door needs a useful hinge origin; a vehicle needs a deliberate movement reference. Apply transforms only when appropriate for the asset and animation workflow, rather than blindly applying them to every rig.
  2. Topology describes how vertices, edges and faces connect. Silhouette, deformation and shading determine useful detail. UV layout and material assignments define texture interpretation. Exporters often triangulate or split vertices at attribute boundaries, so authoring vertex counts need not equal runtime counts.
  3. A game material must fit the target format and renderer. Complex Blender node graphs may need conversion or baking. Inspect supported glTF material features and exported maps; the browser does not execute an arbitrary Blender shader graph.
  4. Armatures and animation add a contract for rest pose, skin weights, clip names and supported channels. Validate representative motion after export. An unrigged prop pipeline can be simpler than an animated-character pipeline; document which one a script supports.
  5. Blender Python can select objects, validate inputs, generate assets and invoke export. Operator options vary with the installed build and addons. Inspect the installed operator's RNA properties and record the tool version, rather than assuming a tutorial's flags always apply.
Read the codepython · educational example
# Outline for a saved Blender file containing selected, unrigged mesh props.
# Run inside Blender's Python environment after reviewing the export destination.
from pathlib import Path
import bpy

if not bpy.data.filepath:
    raise RuntimeError("Save the authoring file before using a relative export path")
selected = list(bpy.context.selected_objects)
if not selected or any(obj.type != "MESH" for obj in selected):
    raise ValueError("This prop pipeline accepts only selected mesh objects")
for obj in selected:
    if any(modifier.type == "ARMATURE" for modifier in obj.modifiers):
        raise ValueError("Skinned meshes need the character pipeline")
    if obj.parent and obj.parent.type == "ARMATURE":
        raise ValueError("Armature-parented objects need the character pipeline")
    if obj.animation_data:
        raise ValueError("Animated objects need additional clip validation")
    if any(abs(value - 1.0) > 1e-6 for value in obj.scale):
        raise ValueError("Review and normalize prop scale before export")
    if not obj.data.uv_layers:
        raise ValueError("This textured-prop contract requires UVs")
properties = set(bpy.ops.export_scene.gltf.get_rna_type().properties.keys())
required = {"filepath", "export_format", "use_selection"}
if not required.issubset(properties):
    raise RuntimeError("Inspect the installed exporter before choosing its options")
destination = Path(bpy.path.abspath("//exports/demo-prop.glb"))
destination.parent.mkdir(parents=True, exist_ok=True)
result = bpy.ops.export_scene.gltf(
    filepath=str(destination), export_format="GLB", use_selection=True
)
if "FINISHED" not in result or not destination.is_file():
    raise RuntimeError("Export did not produce the expected artifact")
# Next: independently validate and load the artifact; existence is not correctness.
  1. Input contract

    This outline deliberately accepts selected unrigged mesh props from a saved file, with unit scale and UVs. It does not claim to handle every character rig or material graph.

  2. Export boundary

    The script checks that expected operator properties exist before invoking them. A successful operator result and file existence establish artifact creation, not visual or runtime quality.

  3. Independent check

    A fresh import or target loader checks bounds, materials, clips and dependencies. A representative browser scene then checks appearance, interaction and budgets.

Production thinking

Take this beyond the example.

This lesson's Python is a reviewed outline, not a claim that Blender was executed in LearnLab. Run authoring tools locally or in a controlled asset-build workflow, with pinned tooling and synthetic inputs. Keep editable sources separate from shipped artifacts, track licenses and provenance, and validate exports without publishing private source assets or production data.

Sources and further reading

Your evidence

unseen is a local learning signal, not a credential or proof of production competence.

Explain the mental model, then explicitly acknowledge it. Opening a page is not evidence.

Supported retries can complete this lesson. Independent evidence and delayed review determine the skill stage.

Next lesson · Choose the representation that fits the scene →