adrianhajdin / project_threejs_ai

https://jsmastery.pro
892 stars 266 forks source link

redline under .geometry . geometry={nodes.T_Shirt_male.geometry} #58

Open berkanioussama opened 6 months ago

berkanioussama commented 6 months ago

Property 'geometry' does not exist on type 'Object3D i use nexjs 14 typescript . not vite js image

berkanioussama commented 5 months ago

i creat another on with js not ts and its work

hannesuw commented 2 months ago

In typescript, you should create a type for GLTF result and assign it to useGLTF hooks.

Create an interface or a type. interface GLTFResult extends GLTF { nodes: { T_Shirt_male: THREE.SkinnedMesh } materials: { lambert1: THREE.MeshStandardMaterial } }

Assign the type to the hooks. const { nodes, materials } = useGLTF("/shirt_baked.glb") as GLTFResult