I have a .glb that I'm trying to load in my react-native app, but I'm getting ReferenceError: Property "Worker" doesn't exist. The file I understand is DRACO compressed and it was exported from blender.
import React, { useRef } from 'react';
import { useGLTF, useAnimations } from '@react-three/drei/native';
import { DRACOLoader } from 'three-stdlib';
export default function Model(props) {
const group = useRef();
const { position } = props;
const { nodes, materials, animations } = useGLTF(
require('./Model_Char.glb'),
true, // Enable DRACO support
loader => {
const dracoLoader = new DRACOLoader();
dracoLoader.setDecoderPath(
'https://www.gstatic.com/draco/versioned/decoders/1.5.7/',
);
dracoLoader.setWorkerLimit(0); // Disable Web Workers for React Native
loader.setDRACOLoader(dracoLoader);
},
);
const { actions } = useAnimations(animations, group);
return (
<group ref={group} {...props} dispose={null}>
<group name="Scene">
<group name="Armature" rotation={[Math.PI / 2, 0, 0]} scale={0.01}>
<skinnedMesh...
I have a
.glb
that I'm trying to load in my react-native app, but I'm gettingReferenceError: Property "Worker" doesn't exist
. The file I understand is DRACO compressed and it was exported from blender.And I'm loading it as:
How do I load my Draco compressed
glb
successfully?