Model Pipeline Addon

The model pipeline addon provides a GLTF asset processing workflow for your 3D models.

What it includes

  • A models/ directory for source GLTF/GLB files
  • Build scripts to optimize and compress models
  • Automatic integration with the Threlte scene

Usage

Place your .gltf or .glb files in the client/models/ directory. The pipeline processes them during build:

# Process models manually
npm run models:build

Loading models in scenes

Use Threlte’s GLTF component from extras:

<script>
  import { GLTF } from '@threlte/extras';
</script>

<GLTF url="/models/character.glb" />

For programmatic access to the loaded model:

<script>
  import { useGltf } from '@threlte/extras';

  const gltf = useGltf('/models/character.glb');
</script>

{#if $gltf}
  <T.Primitive object={$gltf.scene} />
{/if}

Disabling the addon

npx tostada-cli create MyApp -model-pipeline