UNPKG

@needle-tools/engine

Version:

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.

30 lines (29 loc) 1.5 kB
import { Loader, LoadingManager, Material, Object3D } from "three"; import { GLTFLoader, GLTFLoaderPlugin, GLTFParser } from "three/examples/jsm/loaders/GLTFLoader.js"; import { IContext } from "../engine_types.js"; export declare namespace MaterialX { /** * Utility function to load a MaterialX material from a URL. This can be used in your own code to load MaterialX materials outside of the glTF loading process. The URL should point to a MaterialX XML file. */ function loadFromUrl(urlOrXML: string, opts?: { url?: string; loadingManager?: LoadingManager; materialNameOrIndex?: number | string; }): Promise<import("three").Material | null>; } export declare class MaterialXLoader extends Loader<Object3D | null> { loadAsync(url: string, onProgress?: ((event: ProgressEvent<EventTarget>) => void) | undefined): Promise<Object3D>; load(url: string, onLoad: (data: Object3D) => void, onProgress?: ((event: ProgressEvent<EventTarget>) => void) | undefined, onError?: ((err: unknown) => void) | undefined): void; private onLoaded; } export declare class NEEDLE_materialx implements GLTFLoaderPlugin { private readonly context; private readonly loader; private readonly url; private readonly parser; get name(): string; constructor(context: IContext, loader: GLTFLoader, url: string, parser: GLTFParser); private mtlxLoader?; beforeRoot(): Promise<void>; loadMaterial(index: any): Promise<Material> | null; }