Skip to content

setMeshoptDecoder must be called before loading compressed files #13

@fax1ty

Description

@fax1ty
import {
  DRACOLoader,
  GLTFLoader,
  loadGltf as loadAsync,
} from "node-three-gltf";
import { MeshoptDecoder } from "three-stdlib";

export const loadGltf = async (url: string) => {
  const gltf = new GLTFLoader();
  const draco = new DRACOLoader();
  gltf.setDRACOLoader(draco);
  gltf.setMeshoptDecoder(MeshoptDecoder);

  return await loadAsync(url);
};

results in

Error: THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files

How can I load compressed gltfs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions