UNPKG

threepipe

Version:

A modern 3D viewer framework built on top of three.js, written in TypeScript, designed to make creating high-quality, modular, and extensible 3D experiences on the web simple and enjoyable.

47 lines 2.37 kB
import { GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader.js'; import { GLTFWriter } from 'three/examples/jsm/exporters/GLTFExporter.js'; import { ISerializedViewerConfig, ThreeViewer } from '../../viewer'; import { Group } from 'three'; import { SerializationMetaType, SerializationResourcesType } from '../../utils'; import { GLTFWriter2 } from '../export'; export declare class GLTFViewerConfigExtension { static readonly ViewerConfigGLTFExtension = "WEBGI_viewer"; /** * Import viewer config from glTF(exported from {@link GLTFViewerConfigExtension.ExportViewerConfig}) and sets in scene.importedViewerConfig * Must be called from afterRoot in gltf loader. Used in {@link GLTFLoader2.setup} * Only imports, does not apply. * @param parser * @param viewer * @param resultScenes * @param scene */ static ImportViewerConfig(parser: GLTFParser, viewer: ThreeViewer, resultScenes: Group[], scene?: any): Promise<Partial<ISerializedViewerConfig>>; static ImportResources(resources: Partial<SerializationResourcesType>, parser: GLTFParser, viewer: ThreeViewer): Promise<any>; /** * Find resources in parser from uuid * @param currentResources * @param parser * @param viewer * @private */ private static _parseExtraResources; private static _parseArrayBuffers; /** * Export viewer config to glTF(can be imported by {@link GLTFViewerConfigExtension.ImportViewerConfig}). * Used in {@link GLTFExporter2} * @param viewer * @param writer * @constructor */ static ExportViewerConfig(viewer: ThreeViewer, writer: GLTFWriter2): Partial<SerializationResourcesType> | undefined; static BundleArrayBuffers(resources: Partial<SerializationMetaType>, writer: GLTFWriter): void; /** * Find the resources that are in the viewer config AND in writer.json and use the ones in writer and remove from viewer Config. * For now (for the lack of a better way) we can let the resources be exported twice and removed from resources. Overhead will be just for some images. * @param json * @param resources * @private */ static BundleExtraResources(json: GLTFWriter['json'], resources: Partial<SerializationMetaType>): void; } //# sourceMappingURL=../../src/assetmanager/gltf/GLTFViewerConfigExtension.d.ts.map