drei icon indicating copy to clipboard operation
drei copied to clipboard

useGLTF returns incomplete type

Open krispya opened this issue 2 years ago • 2 comments

  • three version: 0.139.2
  • @react-three/fiber version: 8.0.12
  • @react-three/drei version: 9.6.2
  • node version: 14.17.3
  • npm (or yarn) version: 8.9.0

useGLTF returns type GLTF which is defined from the declare file as:

export interface GLTF {
    animations: AnimationClip[];
    scene: Group;
    scenes: Group[];
    cameras: Camera[];
    asset: {
        copyright?: string | undefined;
        generator?: string | undefined;
        version?: string | undefined;
        minVersion?: string | undefined;
        extensions?: any;
        extras?: any;
    };
    parser: GLTFParser;
    userData: any;
}

But it is missing the nodes and materials properties. I'm not sure if this is an issue on the DefinitelyTyped side or something we can fix on the Drei side.

krispya avatar May 09 '22 21:05 krispya

Updates? We can safely patch the package to overwrite this for the time being right?

wiredmatt avatar Jul 17 '22 16:07 wiredmatt

guess you can just use this instead:

npx gltfjsx model.gltf --types

wiredmatt avatar Jul 17 '22 16:07 wiredmatt

I'd love this fixed

rgbjoy avatar Jul 13 '23 18:07 rgbjoy