@pixiv/three-vrm
Version:
VRM file loader for three.js.
23 lines (22 loc) • 1.15 kB
TypeScript
import type { GLTF } from 'three/examples/jsm/loaders/GLTFLoader';
import type { GLTFPrimitive } from '../types';
/**
* Extract primitives ( `THREE.Mesh[]` ) of a node from a loaded GLTF.
* The main purpose of this function is to distinguish primitives and children from a node that has both meshes and children.
*
* It utilizes the behavior that GLTFLoader adds mesh primitives to the node object ( `THREE.Group` ) first then adds its children.
*
* @param gltf A GLTF object taken from GLTFLoader
* @param nodeIndex The index of the node
*/
export declare function gltfExtractPrimitivesFromNode(gltf: GLTF, nodeIndex: number): Promise<GLTFPrimitive[] | null>;
/**
* Extract primitives ( `THREE.Mesh[]` ) of nodes from a loaded GLTF.
* See {@link gltfExtractPrimitivesFromNode} for more details.
*
* It returns a map from node index to extraction result.
* If a node does not have a mesh, the entry for the node will not be put in the returning map.
*
* @param gltf A GLTF object taken from GLTFLoader
*/
export declare function gltfExtractPrimitivesFromNodes(gltf: GLTF): Promise<Map<number, GLTFPrimitive[]>>;