79749746

Date: 2025-08-29 01:27:04
Score: 0.5
Natty:
Report link

The materials need to be separated within the function call...

import React, { useRef } from 'react'
import { useGLTF } from '@react-three/drei'

export default function Model(props) {
  const { nodes, materials } = useGLTF('/shirt_baked.glb')
  return (
    <group {...props} dispose={null}>
      <mesh geometry={nodes.T_Shirt_male.geometry} material={materials.lambert1}>
        <meshLambertMaterial color={props.color} />
      </mesh>
    </group>
  )
}

useGLTF.preload('/shirt_baked.glb')
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Biaspoint