roavatar-renderer 1.9.8 → 1.9.10
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/index.d.ts +123 -7
- package/dist/index.js +581 -235
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1013,6 +1013,9 @@ export declare interface BundleDetails_Result {
|
|
|
1013
1013
|
/** @category Outfit */
|
|
1014
1014
|
export declare const BundleTypes: string[];
|
|
1015
1015
|
|
|
1016
|
+
/**
|
|
1017
|
+
* @category API
|
|
1018
|
+
*/
|
|
1016
1019
|
export declare const CACHE: {
|
|
1017
1020
|
AssetBuffer: Cache_2<string, Promise<ArrayBuffer | Response>>;
|
|
1018
1021
|
RBX: Cache_2<string, RBX>;
|
|
@@ -1026,16 +1029,22 @@ export declare const CACHE: {
|
|
|
1026
1029
|
UserInfo: undefined;
|
|
1027
1030
|
};
|
|
1028
1031
|
|
|
1032
|
+
/**
|
|
1033
|
+
* @category API
|
|
1034
|
+
*/
|
|
1029
1035
|
declare class Cache_2<K, V> {
|
|
1030
1036
|
map: Map<K, V>;
|
|
1031
1037
|
lastAccess: Map<K, number>;
|
|
1032
1038
|
maxEntries: number;
|
|
1039
|
+
minDeleteLifetime: number;
|
|
1033
1040
|
onDelete?: (key: K) => void;
|
|
1034
1041
|
constructor(maxEntries?: number);
|
|
1035
1042
|
get(key: K): V | undefined;
|
|
1036
1043
|
set(key: K, value: V): Cache_2<K, V>;
|
|
1037
1044
|
has(key: K): boolean;
|
|
1038
1045
|
delete(key: K): boolean;
|
|
1046
|
+
deleteUntil(): void;
|
|
1047
|
+
deleteOne(): boolean;
|
|
1039
1048
|
}
|
|
1040
1049
|
export { Cache_2 as Cache }
|
|
1041
1050
|
|
|
@@ -1295,11 +1304,36 @@ export declare function createContentMap(): void;
|
|
|
1295
1304
|
|
|
1296
1305
|
export declare function createThumbnailCamera(): Instance;
|
|
1297
1306
|
|
|
1307
|
+
/**
|
|
1308
|
+
* @returns A RBXRenderScene ready to be used for thumbnail generation
|
|
1309
|
+
*/
|
|
1310
|
+
export declare function createThumbnailScene(): RBXRendererScene;
|
|
1311
|
+
|
|
1298
1312
|
/**
|
|
1299
1313
|
* @category Mesh
|
|
1300
1314
|
*/
|
|
1301
1315
|
export declare function createWeightsForMeshChunked(mesh: FileMesh, ref_mesh: FileMesh): WeightChunk[];
|
|
1302
1316
|
|
|
1317
|
+
/**
|
|
1318
|
+
* Used internally by cropForModel
|
|
1319
|
+
*
|
|
1320
|
+
* @category ThumbnailGenerator
|
|
1321
|
+
*/
|
|
1322
|
+
export declare function cropCameraToViewExtents(camera: THREE.PerspectiveCamera, viewExtents: [Vector2, Vector2], width: number, height: number, keepAspectRatio?: boolean): number;
|
|
1323
|
+
|
|
1324
|
+
/**
|
|
1325
|
+
* Crops the camera projection matrix to only contain model, allows for image to be cropped without lowering resolution
|
|
1326
|
+
* @param model Model that should be in focus
|
|
1327
|
+
* @param renderScene RenderScene containing model and camera
|
|
1328
|
+
* @param width Width of thumbnail in pixels
|
|
1329
|
+
* @param height Height of thumbnail in pixels
|
|
1330
|
+
* @param resizeToRemoveUnusedSpace If the aspect ratio can be changed to crop out unused space. Default false
|
|
1331
|
+
* @returns [newWidth, newHeight] (Only differs from provided width/height if resizeToRemoveUnusedSpace = true)
|
|
1332
|
+
*
|
|
1333
|
+
* @category ThumbnailGenerator
|
|
1334
|
+
*/
|
|
1335
|
+
export declare function cropForModel(model: Instance, renderScene: RBXRendererScene, width: number, height: number, resizeToRemoveUnusedSpace?: boolean): number[];
|
|
1336
|
+
|
|
1303
1337
|
/**
|
|
1304
1338
|
* @category Mesh
|
|
1305
1339
|
*/
|
|
@@ -1386,10 +1420,14 @@ export declare function deformReferenceToBaseBodyParts(reference: FileMesh, targ
|
|
|
1386
1420
|
export declare function deg(radians: number): number;
|
|
1387
1421
|
|
|
1388
1422
|
declare class DisposableDesc {
|
|
1423
|
+
toDispose: THREEDisposable[];
|
|
1424
|
+
managedTextures: ManagedTexture[];
|
|
1389
1425
|
disposeMesh(scene: THREE.Scene, mesh: THREE.Mesh): void;
|
|
1390
1426
|
disposeMeshes(scene: THREE.Scene, meshes: THREE.Mesh[]): void;
|
|
1391
1427
|
disposeRenderLists(renderer: THREE.WebGLRenderer): void;
|
|
1392
1428
|
dispose(_renderer: THREE.WebGLRenderer, _scene: THREE.Scene): void;
|
|
1429
|
+
clearToDispose(): void;
|
|
1430
|
+
removeFromToDispose(disposable: THREEDisposable): void;
|
|
1393
1431
|
}
|
|
1394
1432
|
|
|
1395
1433
|
export declare function disposeMesh(scene: THREE.Scene, mesh: THREE.Mesh): void;
|
|
@@ -1912,6 +1950,13 @@ export declare interface GetInfoForId_Result {
|
|
|
1912
1950
|
"displayName": string;
|
|
1913
1951
|
}
|
|
1914
1952
|
|
|
1953
|
+
/**
|
|
1954
|
+
* Returns 2D bounds for model in screen space
|
|
1955
|
+
*
|
|
1956
|
+
* @category ThumbnailGenerator
|
|
1957
|
+
*/
|
|
1958
|
+
export declare function getModelViewExtents(model: Instance, camera: THREE.Camera, width: number, height: number): [Vector2, Vector2];
|
|
1959
|
+
|
|
1915
1960
|
/**
|
|
1916
1961
|
* @category Mesh
|
|
1917
1962
|
*/
|
|
@@ -1947,6 +1992,14 @@ export declare interface GetSubscription_Result {
|
|
|
1947
1992
|
};
|
|
1948
1993
|
}
|
|
1949
1994
|
|
|
1995
|
+
/**
|
|
1996
|
+
* Calculates the CFrame the camera should be at when generating a thumbnail
|
|
1997
|
+
* @param model The model-like instance to get thumbnail camera for
|
|
1998
|
+
* @returns Thumbnail camera cframe
|
|
1999
|
+
* @category ThumbnailGenerator
|
|
2000
|
+
*/
|
|
2001
|
+
export declare function getThumbnailCamera(model: Instance): Instance;
|
|
2002
|
+
|
|
1950
2003
|
/**
|
|
1951
2004
|
* Calculates the CFrame the camera should be at when generating a thumbnail
|
|
1952
2005
|
* @param model The model-like instance to get thumbnail camera for
|
|
@@ -1991,6 +2044,13 @@ export declare function getUVtoIndexMap(mesh: FileMesh): Map<number, number>;
|
|
|
1991
2044
|
*/
|
|
1992
2045
|
export declare function getUVtoIndicesMap(mesh: FileMesh): Map<number, number[]>;
|
|
1993
2046
|
|
|
2047
|
+
/**
|
|
2048
|
+
* Returns 2D bounds for array of positions in screen spade
|
|
2049
|
+
*
|
|
2050
|
+
* @category ThumbnailGenerator
|
|
2051
|
+
*/
|
|
2052
|
+
export declare function getViewExtents(camera: THREE.Camera, positions: Vector3[], width: number, height: number): [Vector2, Vector2];
|
|
2053
|
+
|
|
1994
2054
|
export declare function getWorkerOnMessage(): (event: MessageEvent) => void;
|
|
1995
2055
|
|
|
1996
2056
|
/**
|
|
@@ -2151,7 +2211,7 @@ export declare const HumanoidRigType: {
|
|
|
2151
2211
|
*
|
|
2152
2212
|
* @category ThumbnailGenerator
|
|
2153
2213
|
*/
|
|
2154
|
-
export declare function imageThumbnailClick(renderScene: RBXRendererScene, width: number, height: number, format: ImageThumbnailFormat, options?: Partial<ImageThumbnailOptions>): Promise<
|
|
2214
|
+
export declare function imageThumbnailClick(renderScene: RBXRendererScene, width: number, height: number, format: ImageThumbnailFormat, options?: Partial<ImageThumbnailOptions>): Promise<ImageThumbnailResult>;
|
|
2155
2215
|
|
|
2156
2216
|
/**
|
|
2157
2217
|
* @category ThumbnailGenerator
|
|
@@ -2163,8 +2223,14 @@ export declare type ImageThumbnailFormat = "png" | "webp" | "jpeg";
|
|
|
2163
2223
|
*/
|
|
2164
2224
|
export declare interface ImageThumbnailOptions {
|
|
2165
2225
|
quality: number;
|
|
2226
|
+
size: Vec2;
|
|
2166
2227
|
}
|
|
2167
2228
|
|
|
2229
|
+
/**
|
|
2230
|
+
* @category
|
|
2231
|
+
*/
|
|
2232
|
+
export declare type ImageThumbnailResult = string | undefined;
|
|
2233
|
+
|
|
2168
2234
|
export declare function imageUrlToDataUrl(imageUrl: string): Promise<string>;
|
|
2169
2235
|
|
|
2170
2236
|
/**
|
|
@@ -2264,6 +2330,11 @@ export declare class Instance {
|
|
|
2264
2330
|
Child(name: string): Instance | undefined;
|
|
2265
2331
|
FindFirstChildOfClass(className: string): Instance | undefined;
|
|
2266
2332
|
FindLastChildOfClass(className: string): Instance | undefined;
|
|
2333
|
+
/**
|
|
2334
|
+
* IMPORTANT: Only works properly for instances with an InstanceWrapper
|
|
2335
|
+
* @param className
|
|
2336
|
+
* @returns
|
|
2337
|
+
*/
|
|
2267
2338
|
IsA(className: string): boolean;
|
|
2268
2339
|
IsDescendantOf(instance: Instance): boolean;
|
|
2269
2340
|
preRender(): void;
|
|
@@ -2615,6 +2686,11 @@ export declare const MakeupType: {
|
|
|
2615
2686
|
Eye: number;
|
|
2616
2687
|
};
|
|
2617
2688
|
|
|
2689
|
+
declare interface ManagedTexture {
|
|
2690
|
+
url: string;
|
|
2691
|
+
params?: TextureParams;
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2618
2694
|
/**
|
|
2619
2695
|
* @category InstanceWrapper
|
|
2620
2696
|
*/
|
|
@@ -2735,9 +2811,7 @@ export declare function minus(v0: Vec3, v1: Vec3): Vec3;
|
|
|
2735
2811
|
*
|
|
2736
2812
|
* @category ThumbnailGenerator
|
|
2737
2813
|
*/
|
|
2738
|
-
export declare function modelThumbnailClick(renderScene: RBXRendererScene, format: ModelThumbnailFormat, options?: Partial<ModelThumbnailOptions>): Promise<
|
|
2739
|
-
[key: string]: unknown;
|
|
2740
|
-
}>;
|
|
2814
|
+
export declare function modelThumbnailClick(renderScene: RBXRendererScene, format: ModelThumbnailFormat, options?: Partial<ModelThumbnailOptions>): Promise<ModelThumbnailResult>;
|
|
2741
2815
|
|
|
2742
2816
|
/**
|
|
2743
2817
|
* @category ThumbnailGenerator
|
|
@@ -2751,6 +2825,13 @@ export declare interface ModelThumbnailOptions {
|
|
|
2751
2825
|
includeAnimations: boolean;
|
|
2752
2826
|
}
|
|
2753
2827
|
|
|
2828
|
+
/**
|
|
2829
|
+
* @category ThumbnailGenerator
|
|
2830
|
+
*/
|
|
2831
|
+
export declare type ModelThumbnailResult = ArrayBuffer | {
|
|
2832
|
+
[key: string]: unknown;
|
|
2833
|
+
};
|
|
2834
|
+
|
|
2754
2835
|
/**
|
|
2755
2836
|
* @category InstanceWrapper
|
|
2756
2837
|
*/
|
|
@@ -3631,9 +3712,18 @@ export declare class RBXRenderer {
|
|
|
3631
3712
|
static removeInstance(instance: Instance, renderScene?: RBXRendererScene): void;
|
|
3632
3713
|
static getRenderDescs(instance: Instance): RenderDesc[];
|
|
3633
3714
|
private static _addSkeletonToResult;
|
|
3715
|
+
private static _updateCompiledRenderDesc;
|
|
3634
3716
|
private static _addRenderDesc;
|
|
3635
|
-
/**
|
|
3636
|
-
|
|
3717
|
+
/** */
|
|
3718
|
+
/**
|
|
3719
|
+
* Adds an instance to the renderer or updates it, add it again to update it after changes have been made
|
|
3720
|
+
* @param instance The instance that will be updated (the descendants will also update)
|
|
3721
|
+
* @param auth This is here just in case something requires it in the future
|
|
3722
|
+
* @param renderScene The scene the instances will be rendered in. Default RBXRenderer.firstScene
|
|
3723
|
+
* @param includeDescendants If descendants should also have addInstance called on them. Default true
|
|
3724
|
+
* @returns
|
|
3725
|
+
*/
|
|
3726
|
+
static addInstance(instance: Instance, auth: Authentication, renderScene?: RBXRendererScene, includeDescendants?: boolean): void;
|
|
3637
3727
|
static setRendererSize(width: number, height: number): void;
|
|
3638
3728
|
/**
|
|
3639
3729
|
* @deprecated Use getRendererElement instead which includes the loading icon
|
|
@@ -3728,6 +3818,12 @@ export declare class RBXRendererScene {
|
|
|
3728
3818
|
* @return true if all have been compiled
|
|
3729
3819
|
*/
|
|
3730
3820
|
isFullyCompiled(): boolean;
|
|
3821
|
+
/**
|
|
3822
|
+
* @param instances Array of instances you want to wait to be finished compiling
|
|
3823
|
+
* @param timeoutSeconds Default is 30 seconds
|
|
3824
|
+
* @returns true if successful, false if a RenderDesc failed to compile or timed out
|
|
3825
|
+
*/
|
|
3826
|
+
waitUntilFullyCompiled(instances: Instance[], timeoutSeconds?: number): Promise<boolean>;
|
|
3731
3827
|
/**
|
|
3732
3828
|
* Exports scene as a GLTF or GLB
|
|
3733
3829
|
* @param name Name of the resulting file if autoDownload is true
|
|
@@ -3996,6 +4092,15 @@ export declare interface Search_Result {
|
|
|
3996
4092
|
}[];
|
|
3997
4093
|
}
|
|
3998
4094
|
|
|
4095
|
+
/**
|
|
4096
|
+
* Sets the APICACHE to a preset value
|
|
4097
|
+
*
|
|
4098
|
+
* @param preset
|
|
4099
|
+
*
|
|
4100
|
+
* @category API
|
|
4101
|
+
*/
|
|
4102
|
+
export declare function setCacheFootprintPreset(preset: "none" | "low" | "normal" | "high"): void;
|
|
4103
|
+
|
|
3999
4104
|
export declare function setupAccessoryCamera(accessoryModel: Instance, camera: Instance): void;
|
|
4000
4105
|
|
|
4001
4106
|
export declare function setupBodyPartCamera(mannequin: Instance, faceRight: boolean, focusPartNames: string[], camera: Instance): void;
|
|
@@ -4005,7 +4110,7 @@ export declare function setupCamera(camera: Instance, cameraOptions: CameraOptio
|
|
|
4005
4110
|
export declare function setupHeadCamera(headModel: Instance, camera: Instance): void;
|
|
4006
4111
|
|
|
4007
4112
|
/**
|
|
4008
|
-
* Gives a scene the default appearance for thumbnails
|
|
4113
|
+
* Gives a scene the default appearance and properties for thumbnails
|
|
4009
4114
|
* @param renderScene RBXRenderScene to setup
|
|
4010
4115
|
*
|
|
4011
4116
|
* @category ThumbnailGenerator
|
|
@@ -4119,6 +4224,17 @@ export declare const TextureMode: {
|
|
|
4119
4224
|
Static: number;
|
|
4120
4225
|
};
|
|
4121
4226
|
|
|
4227
|
+
declare interface TextureParams {
|
|
4228
|
+
colorSpace?: THREE.ColorSpace;
|
|
4229
|
+
wrapS?: THREE.Wrapping;
|
|
4230
|
+
wrapT?: THREE.Wrapping;
|
|
4231
|
+
magFilter?: THREE.MagnificationTextureFilter;
|
|
4232
|
+
minFilter?: THREE.MinificationTextureFilter;
|
|
4233
|
+
generateMipmaps?: boolean;
|
|
4234
|
+
}
|
|
4235
|
+
|
|
4236
|
+
declare type THREEDisposable = THREE.Texture | THREE.BufferGeometry | THREE.Material | THREE.InstancedMesh | THREE.WebGLRenderTarget;
|
|
4237
|
+
|
|
4122
4238
|
declare type ThreePoseCorrective = Vec3;
|
|
4123
4239
|
|
|
4124
4240
|
/**
|