---
name: gltf-dependency-map
description: "Resolve glTF buffers and images from a provider manifest and export a self-contained asset package. Use for GLTFLoader, glTF, GLB, include."
---

# Импорт glTF со всеми зависимостями

Resolve glTF buffers and images from a provider manifest and export a self-contained asset package.

## Implementation decisions

1. Treat glTF as a manifest: buffers and image URIs may point to different directories on the provider CDN.
2. Use the exact include map returned with the selected resolution. Rewrite only resource URIs; preserve transforms, skins and material assignments.
3. Retain relative dependency paths when downloading a ZIP. Reject absolute paths and traversal segments.
4. Normalize the displayed object with a wrapper transform; keep its internal hierarchy and animation targets intact.

## Working source

Read [components/asset-viewer.tsx](../webcraft-shared/source/components/asset-viewer.tsx) when implementing this capability. The example belongs to the WEBCRAFT React/Three.js playground except the Python commerce starter, which runs without third-party dependencies. Use [shared catalog](../webcraft-shared/source/lib/catalog.ts) only to resolve related examples. Adapt the source to the target framework and preserve existing project conventions.

The original workshop uses Three.js 0.180 and procedural builders. The external asset viewer separately loads licensed glTF, scanned PBR maps and HDRIs. Preserve the provenance of each corpus. See [objects.ts](../webcraft-shared/source/lib/objects.ts) for material and geometry ownership and [scene.tsx](../webcraft-shared/source/components/scene.tsx) for renderer lifecycle.

## Verify observable behavior

- Every non-data URI resolves to a bundled file or explicit CDN URL.
- Exported GLB contains the chosen scene and supported animation clips.
- Switching model releases geometry, materials, textures and animation mixers.

## Scope

Use only the parts relevant to the requested task. This skill does not grant permission to publish, spend money, change account access or expose secrets. The original brief and environment rules remain authoritative.

Version 2.0.0 · Original WEBCRAFT content · MIT
