import type { AssetContainer } from "@babylonjs/core/assetContainer"; import type { ISceneLoaderPluginAsync, ISceneLoaderPluginExtensions, ISceneLoaderProgressEvent } from "@babylonjs/core/Loading/sceneLoader"; import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture"; import { Mesh } from "@babylonjs/core/Meshes/mesh"; import type { IFileRequest } from "@babylonjs/core/Misc/fileRequest"; import type { LoadFileError } from "@babylonjs/core/Misc/fileTools"; import type { WebRequest } from "@babylonjs/core/Misc/webRequest"; import type { Scene } from "@babylonjs/core/scene"; import type { Nullable } from "@babylonjs/core/types"; import type { IBuildMaterialResult, IBuildMorphResult, IMmdModelBuildGeometryResult, IMmdModelLoaderOptions, IMmdModelLoadState } from "./mmdModelLoader"; import { MmdModelLoader } from "./mmdModelLoader"; import type { ILogger } from "./Parser/ILogger"; import { PmxObject } from "./Parser/pmxObject"; import type { IProgressTask, Progress } from "./progress"; /** * Options for loading PMX / PMD model */ export interface IPmLoaderOptions extends IMmdModelLoaderOptions { /** * Reference files for load PMX / PMD from files (textures) * * This property is used to load textures from files * * pmx / pmd files typically store texture files separately in a subdirectory of url root * * Therefore, in order to load it as a file, you need to put information about these files separately */ readonly referenceFiles: readonly File[]; /** * Optimize submeshes (default: true) * * This property is used to optimize submeshes during loading * * If set to true, the loader will split submeshes into multiple meshes based on the material * * If you want preserve vertex order, set this to false */ readonly optimizeSubmeshes: boolean; /** * Optimize single material model (default: true) * * This property is used to optimize single material model during loading */ readonly optimizeSingleMaterialModel: boolean; } interface IPmLoadState extends IMmdModelLoadState { readonly referenceFiles: readonly File[]; readonly optimizeSubmeshes: boolean; readonly optimizeSingleMaterialModel: boolean; } interface IPmBuildGeometryResult extends IMmdModelBuildGeometryResult { readonly indices: Uint16Array | Uint32Array; readonly indexToSubmeshIndexMaps: { map: Uint8Array | Uint16Array | Int32Array; isReferencedVertex: Uint8Array; }[]; } /** * @internal * Base class of pmx / pmd loader */ export declare abstract class PmLoader extends MmdModelLoader implements IPmLoaderOptions, ISceneLoaderPluginAsync, ILogger { /** * Reference files for load PMX / PMD from files (textures) * * This property is used to load textures from files * * pmx / pmd files typically store texture files separately in a subdirectory of url root * * Therefore, in order to load it as a file, you need to put information about these files separately */ referenceFiles: readonly File[]; /** * Optimize submeshes (default: true) * * This property is used to optimize submeshes during loading * * If set to true, the loader will split submeshes into multiple meshes based on the material * * If you want preserve vertex order, set this to false */ optimizeSubmeshes: boolean; /** * Optimize single material model (default: true) * * This property is used to optimize single material model during loading */ optimizeSingleMaterialModel: boolean; /** * Create a new PmLoader * * @param name Name of the loader * @param extensions Extensions of the loader * @param options babylon.js scene loader options * @param loaderOptions Overriding options, typically pass global mmd model Loader instance as loaderOptions */ constructor(name: string, extensions: ISceneLoaderPluginExtensions, options?: Partial, loaderOptions?: IPmLoaderOptions); loadFile(scene: Scene, fileOrUrl: string | File | ArrayBufferView, _rootUrl: string, onSuccess: (data: IPmLoadState, responseURL?: string | undefined) => void, onProgress?: ((ev: ISceneLoaderProgressEvent) => void) | undefined, useArrayBuffer?: boolean | undefined, onError?: ((request?: WebRequest | undefined, exception?: LoadFileError | undefined) => void) | undefined): Nullable; protected _effectiveOptimizeSubmeshes(state: IPmLoadState, modelObject: PmxObject): boolean; protected _getProgressTaskCosts(state: IPmLoadState, modelObject: PmxObject): IProgressTask[]; protected _buildGeometryAsync(state: IPmLoadState, modelObject: PmxObject, scene: Scene, assetContainer: Nullable, progress: Progress): Promise; protected _buildMaterialAsync(state: IPmLoadState, modelObject: PmxObject, rootMesh: Mesh, meshes: Mesh[], textureNameMap: Nullable>, scene: Scene, assetContainer: Nullable, rootUrl: string, progress: Progress): Promise; protected _buildMorphAsync(state: IPmLoadState, modelObject: PmxObject, buildGeometryResult: IPmBuildGeometryResult, scene: Scene, assetContainer: Nullable, progress: Progress): Promise; } export {};