react-three-fiber
react-three-fiber copied to clipboard
Unable to load GLTF on react native expo
Hi
Is there a bug with the drei's gltf loader on react native?
Cant seem to load a gltf model
import React, { useRef } from 'react'
import { useGLTF } from '@react-three/drei/native'
export default function Rain(props) {
console.log('rendering rain')
const group = useRef()
const { nodes, materials } = useGLTF('/character.gltf')
console.log('nodes')
console.log(nodes)
var meshes =[]
for(var key in nodes)
{
meshes.push(<mesh
material={nodes[key].material}
geometry={nodes[key].geometry}
/>)
}
console.log('meshes')
console.log(meshes)
return (
<group ref={group} {...props} dispose={null}>
{meshes}
</group>
)
}
useGLTF.preload('/assets/character')
[Unhandled promise rejection: Error: Resource ID #0x0]
Did you find the solution?
When I tried to use useGLTF i get and error "ReferenceError: Can't find variable: crypto"
Nope have not found a solution
Can you post a recreation? This might be related to #1972 where GLTFLoader will fail when loading models with textures due to unimplemented features like Blob => ArrayBuffer.
@dpsilvaa97, I'd create a separate issue for that error, but I'm merging this issue with #1972 since this comes from GLTFLoader's texture path.