minerender 2.1.0-alpha.84 → 2.1.0-alpha.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.d.mts +60 -5
- package/dist/browser/index.d.ts +60 -5
- package/dist/browser/index.js +12513 -15
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +12513 -15
- package/dist/browser/index.mjs.map +1 -1
- package/dist/bundle.js +12516 -15
- package/dist/bundle.js.map +1 -1
- package/dist/node/index.d.mts +60 -5
- package/dist/node/index.d.ts +60 -5
- package/dist/node/index.js +12691 -194
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +12690 -194
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/node/index.d.mts
CHANGED
|
@@ -975,7 +975,7 @@ declare class AssetLoader {
|
|
|
975
975
|
/** Selects an mcasset.cloud version, updates the vanilla source, and clears in-memory caches. */
|
|
976
976
|
static setVersion(version: string): void;
|
|
977
977
|
/**
|
|
978
|
-
* Scope for persistent cache keys. Empty with only the default vanilla
|
|
978
|
+
* Scope for persistent cache keys. Empty with only the default vanilla source, so its
|
|
979
979
|
* entries stay valid across sessions; otherwise it names every added source (resource packs,
|
|
980
980
|
* mirrors) so their results never masquerade as vanilla assets after a reload.
|
|
981
981
|
*/
|
|
@@ -2370,7 +2370,6 @@ declare class Caching {
|
|
|
2370
2370
|
static readonly modelTextureAtlasCache: AsyncLoadingCache<CacheKey, TextureAtlas>;
|
|
2371
2371
|
static readonly blockStateCache: AsyncLoadingCache<CacheKey, BlockState>;
|
|
2372
2372
|
static readonly listAssetCache: AsyncLoadingCache<CacheKey, ListAsset>;
|
|
2373
|
-
static readonly defaultBlockStatesCache: AsyncLoadingCache<CacheKey, DefaultBlockStates>;
|
|
2374
2373
|
static readonly blockTintCache: AsyncLoadingCache<CacheKey, number>;
|
|
2375
2374
|
static readonly entityModelCache: AsyncLoadingCache<CacheKey, EntityModelFile>;
|
|
2376
2375
|
static readonly entityTextureCache: AsyncLoadingCache<CacheKey, AssetKey>;
|
|
@@ -2422,6 +2421,53 @@ declare class SceneExporter {
|
|
|
2422
2421
|
static toGLTF(root: Object3D, options?: SceneGLTFExportOptions): Promise<Record<string, any> | ArrayBuffer>;
|
|
2423
2422
|
}
|
|
2424
2423
|
|
|
2424
|
+
/** Settings passed to {@link Renderer.toVideo}. */
|
|
2425
|
+
interface VideoExportOptions {
|
|
2426
|
+
/** Recording duration in seconds, greater than zero and at most 2147483.647. */
|
|
2427
|
+
duration: number;
|
|
2428
|
+
/** Requested capture rate (default 30). Rendering and browser scheduling can lower the actual rate. */
|
|
2429
|
+
fps?: number;
|
|
2430
|
+
/** Supported video MIME type. Defaults to WebM when available, then MP4. */
|
|
2431
|
+
mimeType?: string;
|
|
2432
|
+
/** Target video bitrate in bits per second, as a positive unsigned 32-bit integer. */
|
|
2433
|
+
videoBitsPerSecond?: number;
|
|
2434
|
+
/** Cancels recording and discards its output. */
|
|
2435
|
+
signal?: AbortSignal;
|
|
2436
|
+
}
|
|
2437
|
+
/**
|
|
2438
|
+
* Records fresh canvas frames in a browser, at a fixed size with an opaque black background.
|
|
2439
|
+
* @internal
|
|
2440
|
+
*/
|
|
2441
|
+
declare class VideoExporter {
|
|
2442
|
+
private readonly source;
|
|
2443
|
+
/** Resolves after the recorder provides its final video data. */
|
|
2444
|
+
readonly result: Promise<Blob>;
|
|
2445
|
+
private readonly canvas;
|
|
2446
|
+
private readonly context;
|
|
2447
|
+
private readonly signal?;
|
|
2448
|
+
private readonly duration;
|
|
2449
|
+
private stream?;
|
|
2450
|
+
private recorder?;
|
|
2451
|
+
private timer?;
|
|
2452
|
+
private readonly chunks;
|
|
2453
|
+
private settled;
|
|
2454
|
+
private stopping;
|
|
2455
|
+
private resolve;
|
|
2456
|
+
private reject;
|
|
2457
|
+
constructor(source: HTMLCanvasElement, options: VideoExportOptions);
|
|
2458
|
+
/** Copies a freshly drawn source frame before WebGL can clear its drawing buffer. */
|
|
2459
|
+
capture(): void;
|
|
2460
|
+
/** Cancels recording, releases its capture stream, and rejects {@link result}. */
|
|
2461
|
+
cancel(reason?: unknown): void;
|
|
2462
|
+
private readonly onStart;
|
|
2463
|
+
private readonly onData;
|
|
2464
|
+
private readonly onStop;
|
|
2465
|
+
private readonly onError;
|
|
2466
|
+
private readonly onAbort;
|
|
2467
|
+
private readonly onTrackEnded;
|
|
2468
|
+
private cleanup;
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2425
2471
|
/** Container coordinates in GUI pixels. Crops refer to vanilla's 256×256 sheets; {@link GuiHelper.container} scales them for resource packs. */
|
|
2426
2472
|
declare const GUI_CONTAINER_LAYOUTS: {
|
|
2427
2473
|
readonly generic_54: {
|
|
@@ -2632,6 +2678,7 @@ declare class Renderer implements Disposable {
|
|
|
2632
2678
|
private _running;
|
|
2633
2679
|
private _inAnimationLoop;
|
|
2634
2680
|
private _disposed;
|
|
2681
|
+
private _videoExporter?;
|
|
2635
2682
|
private readonly _frameCallbacks;
|
|
2636
2683
|
private readonly _debugHelpers;
|
|
2637
2684
|
private readonly _eventDispatchers;
|
|
@@ -2661,9 +2708,9 @@ declare class Renderer implements Disposable {
|
|
|
2661
2708
|
* Registering the same callback twice has no effect. Image exports do not invoke callbacks.
|
|
2662
2709
|
*/
|
|
2663
2710
|
onFrame(callback: FrameCallback): () => void;
|
|
2664
|
-
/** Starts or resumes the animation loop and registered frame callbacks. */
|
|
2711
|
+
/** Starts or resumes the animation loop and registered frame callbacks. Has no effect while running. */
|
|
2665
2712
|
start(): void;
|
|
2666
|
-
/** Pauses rendering and frame callbacks. Call {@link start} to resume. */
|
|
2713
|
+
/** Pauses rendering and frame callbacks, and cancels video export. Call {@link start} to resume. */
|
|
2667
2714
|
stop(): void;
|
|
2668
2715
|
/**
|
|
2669
2716
|
* Stops rendering and releases owned resources. Repeated calls have no effect, and a disposed
|
|
@@ -2679,6 +2726,14 @@ declare class Renderer implements Disposable {
|
|
|
2679
2726
|
* MIME type support and lossy quality (0–1) follow the canvas encoder.
|
|
2680
2727
|
*/
|
|
2681
2728
|
toImage(trim?: boolean, mime?: string, quality?: number): string;
|
|
2729
|
+
/**
|
|
2730
|
+
* Records a silent browser video in real time, including frame callbacks and animated textures.
|
|
2731
|
+
* Keep the tab visible; browser scheduling and `render.fpsLimit` limit the capture rate.
|
|
2732
|
+
* The video keeps the initial drawing-buffer size and fills transparent pixels with black.
|
|
2733
|
+
* Temporarily starts a stopped renderer. Stop, disposal, or `options.signal` cancels the export.
|
|
2734
|
+
* Only one export can run at a time. Use the returned Blob's type to select a file extension.
|
|
2735
|
+
*/
|
|
2736
|
+
toVideo(options: VideoExportOptions): Promise<Blob>;
|
|
2682
2737
|
/** Exports visible scene meshes as OBJ text, without texture images. */
|
|
2683
2738
|
toObj(): string;
|
|
2684
2739
|
/** Exports visible scene meshes as PLY. Set `options.binary` for an ArrayBuffer. */
|
|
@@ -3300,4 +3355,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
|
|
|
3300
3355
|
forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
|
|
3301
3356
|
}
|
|
3302
3357
|
|
|
3303
|
-
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveAssetSourceOptions, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, type BannerPattern, type BannerPatternDraw, BannerPatterns, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type BitmapFont, type BitmapGlyph, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, DYE_COLORS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type DyeColor, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, Fonts, type FrameCallback, type FromTo, GUI_CONTAINER_LAYOUTS, Geometries, type GuiBookButtonState, type GuiBookOptions, type GuiBossBarColor, type GuiBossBarOptions, type GuiContainerType, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiText, type GuiTextLayer, type GuiTextLayout, type GuiTextOptions, type GuiTextRun, type GuiTextStyle, type GuiTextureLayer, type GuiTooltipOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelContext, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, type LoadedSceneDocument, type LoadedSceneObject, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, OrbitControls, type PackFormat, PackFormats, PackMetadata, PersistentCache, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, type SceneBlockDefinition, type SceneDocument, SceneDocumentLoader, type SceneEntityDefinition, SceneExporter, type SceneGLTFExportOptions, type SceneGuiDefinition, type SceneGuiLayer, SceneInspector, type SceneModelDefinition, SceneObject, type SceneObjectDefinition, type SceneObjectDefinitionBase, type SceneObjectOptions, type SceneSkinDefinition, type SceneSkinPosePart, SceneStats, SceneStatsDisplay, SchematicParser, type SchematicParserOptions, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, registerNodeEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
|
|
3358
|
+
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveAssetSourceOptions, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, type BannerPattern, type BannerPatternDraw, BannerPatterns, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type BitmapFont, type BitmapGlyph, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, DYE_COLORS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type DyeColor, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, Fonts, type FrameCallback, type FromTo, GUI_CONTAINER_LAYOUTS, Geometries, type GuiBookButtonState, type GuiBookOptions, type GuiBossBarColor, type GuiBossBarOptions, type GuiContainerType, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiText, type GuiTextLayer, type GuiTextLayout, type GuiTextOptions, type GuiTextRun, type GuiTextStyle, type GuiTextureLayer, type GuiTooltipOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelContext, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, type LoadedSceneDocument, type LoadedSceneObject, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, OrbitControls, type PackFormat, PackFormats, PackMetadata, PersistentCache, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, type SceneBlockDefinition, type SceneDocument, SceneDocumentLoader, type SceneEntityDefinition, SceneExporter, type SceneGLTFExportOptions, type SceneGuiDefinition, type SceneGuiLayer, SceneInspector, type SceneModelDefinition, SceneObject, type SceneObjectDefinition, type SceneObjectDefinitionBase, type SceneObjectOptions, type SceneSkinDefinition, type SceneSkinPosePart, SceneStats, SceneStatsDisplay, SchematicParser, type SchematicParserOptions, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, type VideoExportOptions, VideoExporter, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, registerNodeEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -975,7 +975,7 @@ declare class AssetLoader {
|
|
|
975
975
|
/** Selects an mcasset.cloud version, updates the vanilla source, and clears in-memory caches. */
|
|
976
976
|
static setVersion(version: string): void;
|
|
977
977
|
/**
|
|
978
|
-
* Scope for persistent cache keys. Empty with only the default vanilla
|
|
978
|
+
* Scope for persistent cache keys. Empty with only the default vanilla source, so its
|
|
979
979
|
* entries stay valid across sessions; otherwise it names every added source (resource packs,
|
|
980
980
|
* mirrors) so their results never masquerade as vanilla assets after a reload.
|
|
981
981
|
*/
|
|
@@ -2370,7 +2370,6 @@ declare class Caching {
|
|
|
2370
2370
|
static readonly modelTextureAtlasCache: AsyncLoadingCache<CacheKey, TextureAtlas>;
|
|
2371
2371
|
static readonly blockStateCache: AsyncLoadingCache<CacheKey, BlockState>;
|
|
2372
2372
|
static readonly listAssetCache: AsyncLoadingCache<CacheKey, ListAsset>;
|
|
2373
|
-
static readonly defaultBlockStatesCache: AsyncLoadingCache<CacheKey, DefaultBlockStates>;
|
|
2374
2373
|
static readonly blockTintCache: AsyncLoadingCache<CacheKey, number>;
|
|
2375
2374
|
static readonly entityModelCache: AsyncLoadingCache<CacheKey, EntityModelFile>;
|
|
2376
2375
|
static readonly entityTextureCache: AsyncLoadingCache<CacheKey, AssetKey>;
|
|
@@ -2422,6 +2421,53 @@ declare class SceneExporter {
|
|
|
2422
2421
|
static toGLTF(root: Object3D, options?: SceneGLTFExportOptions): Promise<Record<string, any> | ArrayBuffer>;
|
|
2423
2422
|
}
|
|
2424
2423
|
|
|
2424
|
+
/** Settings passed to {@link Renderer.toVideo}. */
|
|
2425
|
+
interface VideoExportOptions {
|
|
2426
|
+
/** Recording duration in seconds, greater than zero and at most 2147483.647. */
|
|
2427
|
+
duration: number;
|
|
2428
|
+
/** Requested capture rate (default 30). Rendering and browser scheduling can lower the actual rate. */
|
|
2429
|
+
fps?: number;
|
|
2430
|
+
/** Supported video MIME type. Defaults to WebM when available, then MP4. */
|
|
2431
|
+
mimeType?: string;
|
|
2432
|
+
/** Target video bitrate in bits per second, as a positive unsigned 32-bit integer. */
|
|
2433
|
+
videoBitsPerSecond?: number;
|
|
2434
|
+
/** Cancels recording and discards its output. */
|
|
2435
|
+
signal?: AbortSignal;
|
|
2436
|
+
}
|
|
2437
|
+
/**
|
|
2438
|
+
* Records fresh canvas frames in a browser, at a fixed size with an opaque black background.
|
|
2439
|
+
* @internal
|
|
2440
|
+
*/
|
|
2441
|
+
declare class VideoExporter {
|
|
2442
|
+
private readonly source;
|
|
2443
|
+
/** Resolves after the recorder provides its final video data. */
|
|
2444
|
+
readonly result: Promise<Blob>;
|
|
2445
|
+
private readonly canvas;
|
|
2446
|
+
private readonly context;
|
|
2447
|
+
private readonly signal?;
|
|
2448
|
+
private readonly duration;
|
|
2449
|
+
private stream?;
|
|
2450
|
+
private recorder?;
|
|
2451
|
+
private timer?;
|
|
2452
|
+
private readonly chunks;
|
|
2453
|
+
private settled;
|
|
2454
|
+
private stopping;
|
|
2455
|
+
private resolve;
|
|
2456
|
+
private reject;
|
|
2457
|
+
constructor(source: HTMLCanvasElement, options: VideoExportOptions);
|
|
2458
|
+
/** Copies a freshly drawn source frame before WebGL can clear its drawing buffer. */
|
|
2459
|
+
capture(): void;
|
|
2460
|
+
/** Cancels recording, releases its capture stream, and rejects {@link result}. */
|
|
2461
|
+
cancel(reason?: unknown): void;
|
|
2462
|
+
private readonly onStart;
|
|
2463
|
+
private readonly onData;
|
|
2464
|
+
private readonly onStop;
|
|
2465
|
+
private readonly onError;
|
|
2466
|
+
private readonly onAbort;
|
|
2467
|
+
private readonly onTrackEnded;
|
|
2468
|
+
private cleanup;
|
|
2469
|
+
}
|
|
2470
|
+
|
|
2425
2471
|
/** Container coordinates in GUI pixels. Crops refer to vanilla's 256×256 sheets; {@link GuiHelper.container} scales them for resource packs. */
|
|
2426
2472
|
declare const GUI_CONTAINER_LAYOUTS: {
|
|
2427
2473
|
readonly generic_54: {
|
|
@@ -2632,6 +2678,7 @@ declare class Renderer implements Disposable {
|
|
|
2632
2678
|
private _running;
|
|
2633
2679
|
private _inAnimationLoop;
|
|
2634
2680
|
private _disposed;
|
|
2681
|
+
private _videoExporter?;
|
|
2635
2682
|
private readonly _frameCallbacks;
|
|
2636
2683
|
private readonly _debugHelpers;
|
|
2637
2684
|
private readonly _eventDispatchers;
|
|
@@ -2661,9 +2708,9 @@ declare class Renderer implements Disposable {
|
|
|
2661
2708
|
* Registering the same callback twice has no effect. Image exports do not invoke callbacks.
|
|
2662
2709
|
*/
|
|
2663
2710
|
onFrame(callback: FrameCallback): () => void;
|
|
2664
|
-
/** Starts or resumes the animation loop and registered frame callbacks. */
|
|
2711
|
+
/** Starts or resumes the animation loop and registered frame callbacks. Has no effect while running. */
|
|
2665
2712
|
start(): void;
|
|
2666
|
-
/** Pauses rendering and frame callbacks. Call {@link start} to resume. */
|
|
2713
|
+
/** Pauses rendering and frame callbacks, and cancels video export. Call {@link start} to resume. */
|
|
2667
2714
|
stop(): void;
|
|
2668
2715
|
/**
|
|
2669
2716
|
* Stops rendering and releases owned resources. Repeated calls have no effect, and a disposed
|
|
@@ -2679,6 +2726,14 @@ declare class Renderer implements Disposable {
|
|
|
2679
2726
|
* MIME type support and lossy quality (0–1) follow the canvas encoder.
|
|
2680
2727
|
*/
|
|
2681
2728
|
toImage(trim?: boolean, mime?: string, quality?: number): string;
|
|
2729
|
+
/**
|
|
2730
|
+
* Records a silent browser video in real time, including frame callbacks and animated textures.
|
|
2731
|
+
* Keep the tab visible; browser scheduling and `render.fpsLimit` limit the capture rate.
|
|
2732
|
+
* The video keeps the initial drawing-buffer size and fills transparent pixels with black.
|
|
2733
|
+
* Temporarily starts a stopped renderer. Stop, disposal, or `options.signal` cancels the export.
|
|
2734
|
+
* Only one export can run at a time. Use the returned Blob's type to select a file extension.
|
|
2735
|
+
*/
|
|
2736
|
+
toVideo(options: VideoExportOptions): Promise<Blob>;
|
|
2682
2737
|
/** Exports visible scene meshes as OBJ text, without texture images. */
|
|
2683
2738
|
toObj(): string;
|
|
2684
2739
|
/** Exports visible scene meshes as PLY. Set `options.binary` for an ArrayBuffer. */
|
|
@@ -3300,4 +3355,4 @@ declare class NodeCache extends PersistentCache<LocalStorage> {
|
|
|
3300
3355
|
forEach<T>(callback: (v: T, k: string) => void): Promise<void>;
|
|
3301
3356
|
}
|
|
3302
3357
|
|
|
3303
|
-
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveAssetSourceOptions, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, type BannerPattern, type BannerPatternDraw, BannerPatterns, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type BitmapFont, type BitmapGlyph, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, DYE_COLORS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type DyeColor, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, Fonts, type FrameCallback, type FromTo, GUI_CONTAINER_LAYOUTS, Geometries, type GuiBookButtonState, type GuiBookOptions, type GuiBossBarColor, type GuiBossBarOptions, type GuiContainerType, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiText, type GuiTextLayer, type GuiTextLayout, type GuiTextOptions, type GuiTextRun, type GuiTextStyle, type GuiTextureLayer, type GuiTooltipOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelContext, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, type LoadedSceneDocument, type LoadedSceneObject, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, OrbitControls, type PackFormat, PackFormats, PackMetadata, PersistentCache, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, type SceneBlockDefinition, type SceneDocument, SceneDocumentLoader, type SceneEntityDefinition, SceneExporter, type SceneGLTFExportOptions, type SceneGuiDefinition, type SceneGuiLayer, SceneInspector, type SceneModelDefinition, SceneObject, type SceneObjectDefinition, type SceneObjectDefinitionBase, type SceneObjectOptions, type SceneSkinDefinition, type SceneSkinPosePart, SceneStats, SceneStatsDisplay, SchematicParser, type SchematicParserOptions, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, registerNodeEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
|
|
3358
|
+
export { AXES, type AnimationFrame, type AnimationMeta, type AnimatorFunction, type AnvilChunk, AnvilParser, type AnvilRegion, ArchiveAssetSource, type ArchiveAssetSourceOptions, type ArchiveEntry, type ArchiveProxy, AssetKey, AssetLoadError, AssetLoader, AssetParser, AssetSource, type AssetType, Assets, Axis, BUILTIN_ENTITY, BUILTIN_GENERATED, type BannerPattern, type BannerPatternDraw, BannerPatterns, BasicAssetKey, type BasicMinecraftAsset, BatchedExecutor, type BedrockBone, type BedrockCube, type BedrockEntityDescription, type BedrockEntityFile, type BedrockGeometry, type BedrockGeometryFile, type BitmapFont, type BitmapGlyph, type Block, BlockEntities, type BlockEntityEntry, type BlockEntityIndex, type BlockEntityPart, type BlockEntityRotation, type BlockFluidState, type BlockInfo, type BlockModel, type BlockModelTextures, BlockObject, type BlockObjectOptions, type BlockState, type BlockStateMultipart, type BlockStateProperties, type BlockStateProperty, type BlockStatePropertyDefaults, type BlockStatePropertyValue, BlockStateResolver, type BlockStateVariant, type BlockStateVariants, BlockStates, BlockTints, type BoxGeometryKey, BrowserArchiveProxy, CUBE_FACES, CUBE_FACE_OFFSETS, type CacheKey, Caching, type CameraOptions, CanvasImage, type CapeLayout, Chunk, ChunkData, Colormaps, type CompatCanvas, type CompatImage, type ComposerOptions, type ControlsOptions, CubeFace, CubeFaceIndex, DEFAULT_ELEMENTS, DEFAULT_NAMESPACE, DEFAULT_ROOT, DEFAULT_UV, DISPLAY_POSITIONS, DYE_COLORS, type DebugOptions, type DeepPartial, DefaultBlockStates, DisplayPosition, DisplayTransforms, type Disposable, type DoubleArray, type DyeColor, ENTITY_ANIMATION_CHANNELS, type ElementFace, type ElementRotation, Entities, type EntityAnimation, type EntityAnimationBone, type EntityAnimationChannel, type EntityAnimationFile, type EntityAnimationKeyframe, type EntityAnimationOptions, EntityAnimationPlayer, type EntityAnimationPose, type EntityLayer, type EntityModel, type EntityModelCube, type EntityModelFile, type EntityModelLayer, type EntityModelOptions, type EntityModelPart, type EntityModelPass, EntityObject, type EntityObjectOptions, type EntityRenderMode, type EntityTransformOp, Env, type EnvProvider, type ExtractableImageData, type FluidKind, FluidModelObject, type FluidSample, type FluidSampler, Fonts, type FrameCallback, type FromTo, GUI_CONTAINER_LAYOUTS, Geometries, type GuiBookButtonState, type GuiBookOptions, type GuiBossBarColor, type GuiBossBarOptions, type GuiContainerType, GuiHelper, type GuiItemLayer, type GuiLayer, GuiLight, GuiObject, type GuiObjectOptions, type GuiRecipe, type GuiRecipeIngredient, type GuiRecipeOptions, type GuiSpriteScaling, type GuiText, type GuiTextLayer, type GuiTextLayout, type GuiTextOptions, type GuiTextRun, type GuiTextStyle, type GuiTextureLayer, type GuiTooltipOptions, HostedAssetSource, type IModelTextures, ITEM_GENERATED, type ImageInfo, ImageLoader, type ImageSizeInfo, InstanceManager, InstanceReference, type Instanceable, type ItemModel, type ItemModelContext, type ItemModelTextures, type ItemTintColor, type ItemTintSource, ItemTints, type ListAsset, type LoadedSceneDocument, type LoadedSceneObject, MapControls, type MaterialKey, Materials, type Maybe, type MeshKey, Meshes, MineRenderError, MineRenderScene, type MineRenderSceneOptions, MineRenderWorld, type MineRenderWorldOptions, type MinecraftAsset, MinecraftCubeTexture, MinecraftFaceUV, type MinecraftTextureMeta, type Model, ModelCulling, type ModelDisplay, type ModelElement, type ModelFaces, ModelGenerator, ModelMerger, ModelObject, type ModelObjectOptions, ModelTextures, Models, type MultiBlockBlock, type MultiBlockEntity, type MultiBlockStructure, type MultipartCondition, type NBTAsset, NBTHelper, NodeCache, NodeEnv, OrbitControls, type PackFormat, PackFormats, PackMetadata, PersistentCache, type PositionedGuiGlyph, type QuadArray, type RawImageKey, type RenderOptions, Renderer, type RendererFrame, type RendererOptions, type RequestConfig, RequestError, type RequestResponse, Requests, type ResolvedBlockEntity, type ResponseParser, SKIN_PARTS, type SceneBlockDefinition, type SceneDocument, SceneDocumentLoader, type SceneEntityDefinition, SceneExporter, type SceneGLTFExportOptions, type SceneGuiDefinition, type SceneGuiLayer, SceneInspector, type SceneModelDefinition, SceneObject, type SceneObjectDefinition, type SceneObjectDefinitionBase, type SceneObjectOptions, type SceneSkinDefinition, type SceneSkinPosePart, SceneStats, SceneStatsDisplay, SchematicParser, type SchematicParserOptions, SectionMesh, type SectionMeshEntry, type SectionMeshTemplate, SectionModels, type Serializable, type SkinGeometries, SkinImage, SkinObject, type SkinObjectOptions, SkinPart, type SkinTexture, type SkinTextureCoordinates, SkinTextures, Skins, type SpecialItemPart, type SpecialItemRenderer, SpecialItems, type StructureNBT, StructureParser, type TextureAsset, TextureAtlas, type TextureKey, TextureLoader, Textures, Ticker, type TickerFunction, TintColors, type Transformable, type TripleArray, UVMapper, type VideoExportOptions, VideoExporter, WrappedImage, addBox3WireframeToObject, addWireframeToMesh, addWireframeToObject, applyElementRotation, applyGenericRotation, axisToVec3, base64decode, base64encode, capeTextureSizes, captureException, changeEvent, clampRotationDegrees, classicSkinGeometries, classicSkinTextureCoordinates, computeMorphedAttributes, createCanvas, createFluidGeometry, createGuiTextGeometry, createGuiTextureGeometry, createImage, entityAnimationTime, estimateBytesUsed, getBlockFluidState, getFluidKind, interleaveAttributes, isAssetKey, isBasicAssetKey, isBlockObject, isDisposable, isDoubleArray, isEntityObject, isGuiObject, isInstanceManager, isInstanceReference, isInstanceable, isInstancedMesh, isMesh, isMineRenderScene, isModelObject, isObject3D, isOrthographicCamera, isPerspectiveCamera, isQuadArray, isSceneObject, isTransformable, isTripleArray, isVector3, layoutGuiText, md5, mergeBufferAttributes, mergeBufferGeometries, mergeVertices, parseSceneDocument, prefix, registerNodeEnv, sampleEntityAnimation, sampleEntityKeyframes, sampleFluid, serializeBoxGeometryKey, serializeImageKey, serializeMaterialKey, serializeMeshKey, serializeTextureKey, sha1, sha256, sha512, shutdown, sleep, slimSkinGeometries, slimSkinTextureCoordinates, timingEnd, timingStart, toDegrees, toRadians, toTrianglesDrawMode, trimCanvas };
|