roavatar-renderer 1.5.17 → 1.5.19
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 +261 -29
- package/dist/index.js +847 -312
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -88,6 +88,8 @@ export declare const AllAnimations: AnimationProp[];
|
|
|
88
88
|
|
|
89
89
|
export declare const AllAnimationSorts: ItemSort[];
|
|
90
90
|
|
|
91
|
+
export declare const AllAvatarModelOutfitUpdateTypes: AvatarModelUpdateType[];
|
|
92
|
+
|
|
91
93
|
export declare const AllBodyParts: number[];
|
|
92
94
|
|
|
93
95
|
export declare const AllBodyPartsSorts: ItemSort[];
|
|
@@ -313,11 +315,28 @@ export declare const API: {
|
|
|
313
315
|
WearOutfit: (auth: Authentication, outfit: Outfit, onlyItems: boolean) => Promise<[boolean, boolean]>;
|
|
314
316
|
SaveOutfitNoRetry: (auth: Authentication, outfit: Outfit) => Promise<Response>;
|
|
315
317
|
GetAvatarDetails: (userId: number) => Promise<Response | Outfit>;
|
|
318
|
+
GetAvatarModel: () => Promise<Response | OutfitModel>;
|
|
319
|
+
UpdateAvatarModel: (auth: Authentication, model: OutfitModel, updateTypes?: AvatarModelUpdateType[]) => Promise<Response>;
|
|
320
|
+
GetOutfitModel: (id: number | string, creatorId: number) => Promise<Response | OutfitModel>;
|
|
321
|
+
CreateOutfitModel: (auth: Authentication, model: OutfitModel) => Promise<Response>;
|
|
322
|
+
UpdateOutfitModel: (auth: Authentication, model: OutfitModel, id: number, updateTypes?: AvatarModelUpdateType[]) => Promise<Response>;
|
|
316
323
|
GetHeadShapes: (pageToken: string | null | undefined) => Promise<AvatarInventory_Result | Response>;
|
|
317
324
|
GetAvatarInventory: (sortOption: string, pageToken: string | null | undefined, itemInfos?: ItemSort[]) => Promise<AvatarInventory_Result | Response>;
|
|
325
|
+
/**
|
|
326
|
+
* @deprecated Use GetOutfitModel instead
|
|
327
|
+
*/
|
|
318
328
|
GetOutfitDetails: (outfitId: number | string, userId: number) => Promise<Response | Outfit>;
|
|
329
|
+
/**
|
|
330
|
+
* @deprecated Use CreateOutfitModel instead
|
|
331
|
+
*/
|
|
319
332
|
SaveOutfit: (auth: Authentication, outfit: Outfit) => Promise<Response>;
|
|
333
|
+
/**
|
|
334
|
+
* @deprecated Use UpdateOutfitModel instead
|
|
335
|
+
*/
|
|
320
336
|
UpdateOutfit: (auth: Authentication, outfitId: number | string, newOutfit: Outfit) => Promise<Response>;
|
|
337
|
+
/**
|
|
338
|
+
* @deprecated Use UpdateOutfitModel instead
|
|
339
|
+
*/
|
|
321
340
|
PatchOutfit: (auth: Authentication, outfitId: number | string, patchData: any) => Promise<Response>;
|
|
322
341
|
DeleteOutfit: (auth: Authentication, outfitId: number | string) => Promise<Response>;
|
|
323
342
|
GetUserOutfits: (userId: number) => Promise<Response | GetUserOutfits_Result>;
|
|
@@ -345,16 +364,16 @@ export declare const API: {
|
|
|
345
364
|
IsLayered: (id: number) => Promise<boolean | Response>;
|
|
346
365
|
};
|
|
347
366
|
Catalog: {
|
|
348
|
-
GetNavigationMenuItems: () => Promise<
|
|
349
|
-
GetTopics: (auth: Authentication, body: GetTopics_Payload) => Promise<
|
|
350
|
-
Search: ({ taxonomy, salesTypeFilter, sortType, categoryFilter, keyword, topics, creatorName, minPrice, maxPrice, includeNotForSale, limit }: Search_Payload, cursor?: string) => Promise<
|
|
351
|
-
GetBundleDetails: (bundleId: number | string) => Promise<
|
|
367
|
+
GetNavigationMenuItems: () => Promise<Response | NavigationMenuItems>;
|
|
368
|
+
GetTopics: (auth: Authentication, body: GetTopics_Payload) => Promise<Response | GetTopics_Result>;
|
|
369
|
+
Search: ({ taxonomy, salesTypeFilter, sortType, categoryFilter, keyword, topics, creatorName, minPrice, maxPrice, includeNotForSale, limit }: Search_Payload, cursor?: string) => Promise<Response | Search_Result>;
|
|
370
|
+
GetBundleDetails: (bundleId: number | string) => Promise<Response | BundleDetails_Result>;
|
|
352
371
|
GetItemDetails: (auth: Authentication, items: {
|
|
353
372
|
itemType: "Asset" | "Bundle";
|
|
354
373
|
id: number;
|
|
355
|
-
}[]) => Promise<
|
|
356
|
-
GetMarketplaceWidgetsSearch: (query: string) => Promise<
|
|
357
|
-
GetMarketplaceWidgets: (context?: string) => Promise<
|
|
374
|
+
}[]) => Promise<Response | ItemDetails_Result>;
|
|
375
|
+
GetMarketplaceWidgetsSearch: (query: string) => Promise<Response | MarketplaceWidgets_Result>;
|
|
376
|
+
GetMarketplaceWidgets: (context?: string) => Promise<Response | MarketplaceWidgets_Result>;
|
|
358
377
|
};
|
|
359
378
|
Develop: {
|
|
360
379
|
GetLatestVersions: (auth: Authentication, assetIds: number[]) => Promise<Response | LatestVersions_Result>;
|
|
@@ -366,7 +385,7 @@ export declare const API: {
|
|
|
366
385
|
Users: {
|
|
367
386
|
GetUserInfo: () => Promise<UserInfo | undefined>;
|
|
368
387
|
GetIdsFromUsernames: (usernames: string[]) => Promise<any>;
|
|
369
|
-
GetInfoForId: (userId: number) => Promise<
|
|
388
|
+
GetInfoForId: (userId: number) => Promise<Response | GetInfoForId_Result>;
|
|
370
389
|
UserOmniSearch: (query: string, cursor?: string) => Promise<Response | UserOmniSearch_Result>;
|
|
371
390
|
};
|
|
372
391
|
Thumbnails: {
|
|
@@ -576,6 +595,19 @@ export declare class Authentication {
|
|
|
576
595
|
getSessionUUID(): string;
|
|
577
596
|
}
|
|
578
597
|
|
|
598
|
+
declare interface AvatarConfigurations {
|
|
599
|
+
emotes?: {
|
|
600
|
+
assetId: number;
|
|
601
|
+
assetName: string;
|
|
602
|
+
position: number;
|
|
603
|
+
}[];
|
|
604
|
+
background?: {
|
|
605
|
+
backgroundAsset: AssetJson;
|
|
606
|
+
};
|
|
607
|
+
thumbnailCustomizations?: ThumbnailsCustomization_Payload[];
|
|
608
|
+
profileFrame: null;
|
|
609
|
+
}
|
|
610
|
+
|
|
579
611
|
/**@category API */
|
|
580
612
|
export declare interface AvatarInventory_Result {
|
|
581
613
|
avatarInventoryItems: {
|
|
@@ -616,6 +648,13 @@ export declare interface AvatarInventory_Result {
|
|
|
616
648
|
nextPageToken: string | null;
|
|
617
649
|
}
|
|
618
650
|
|
|
651
|
+
export declare interface AvatarModel_Result {
|
|
652
|
+
avatarModel: OutfitJson;
|
|
653
|
+
avatarConfigurations: AvatarConfigurations | null;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
export declare type AvatarModelUpdateType = "UpdateName" | "UpdateBodyColors" | "UpdateAssets" | "UpdateScales" | "UpdateBackground" | "UpdateAvatarType";
|
|
657
|
+
|
|
619
658
|
/** @category Outfit */
|
|
620
659
|
export declare type AvatarType = "R6" | "R15";
|
|
621
660
|
|
|
@@ -719,6 +758,12 @@ export declare type BodyColor3sJson = {
|
|
|
719
758
|
leftArmColor3?: string;
|
|
720
759
|
rightLegColor3?: string;
|
|
721
760
|
leftLegColor3?: string;
|
|
761
|
+
headColor?: string;
|
|
762
|
+
torsoColor?: string;
|
|
763
|
+
rightArmColor?: string;
|
|
764
|
+
leftArmColor?: string;
|
|
765
|
+
rightLegColor?: string;
|
|
766
|
+
leftLegColor?: string;
|
|
722
767
|
};
|
|
723
768
|
|
|
724
769
|
/**@category Outfit */
|
|
@@ -929,6 +974,7 @@ export declare class CFrame {
|
|
|
929
974
|
fromMatrix(m: Mat4x4): this;
|
|
930
975
|
fromRotationMatrix(r00: number, r01: number, r02: number, r10: number, r11: number, r12: number, r20: number, r21: number, r22: number, order?: string): void;
|
|
931
976
|
lookVector(): Vec3;
|
|
977
|
+
upVector(): Vec3;
|
|
932
978
|
static lookAt(eye: Vec3, target: Vec3, up?: Vec3): CFrame;
|
|
933
979
|
static fromEulerAngles(rx: number, ry: number, rz: number, order?: THREE.EulerOrder): CFrame;
|
|
934
980
|
inverse(): CFrame;
|
|
@@ -1447,9 +1493,15 @@ export declare const FLAGS: {
|
|
|
1447
1493
|
ALWAYS_SHOW_ATTACHMENTS: boolean;
|
|
1448
1494
|
/**Multiplier for delta time used by renderer things (does not affect datamodel side of things but particles and such instead) */
|
|
1449
1495
|
RENDERER_DELTA_TIME_MULTIPLIER: number;
|
|
1450
|
-
/**
|
|
1496
|
+
/**
|
|
1497
|
+
* How many seconds particles will presimulate (mainly so they arent incomplete in thumbnail generations)
|
|
1498
|
+
* @deprecated This can now be set per-scene
|
|
1499
|
+
* */
|
|
1451
1500
|
PARTICLES_START_FULL: number;
|
|
1452
|
-
/**
|
|
1501
|
+
/**
|
|
1502
|
+
* Framerate of presimulation particles
|
|
1503
|
+
* @deprecated This can now be set per-scene
|
|
1504
|
+
* */
|
|
1453
1505
|
PARTICLES_START_FULL_FRAMERATE: number;
|
|
1454
1506
|
/**shows ThreeJS SkeletonHelper */
|
|
1455
1507
|
SHOW_SKELETON_HELPER: boolean;
|
|
@@ -1527,6 +1579,7 @@ export declare function gaussian_rbf(v0: Vec3, v1: Vec3, sigma?: number): number
|
|
|
1527
1579
|
* @param gltfAutoDownload Automatically download gltf file
|
|
1528
1580
|
* @returns ThumbnailResult, always a string for 2d thumbnails, 3d can be ArrayBuffer (glb, binary) or {[key: string]: unknown} (gltf, json)
|
|
1529
1581
|
*
|
|
1582
|
+
* @deprecated Use new Thumbnails category instead
|
|
1530
1583
|
* @category ThumbnailGenerator
|
|
1531
1584
|
*
|
|
1532
1585
|
* @example
|
|
@@ -1555,6 +1608,8 @@ export declare function gaussian_rbf(v0: Vec3, v1: Vec3, sigma?: number): number
|
|
|
1555
1608
|
*/
|
|
1556
1609
|
export declare function generateModelThumbnail(auth: Authentication, renderScene: RBXRendererScene, model: Instance, size?: Vec2, type?: ThumbnailType, quality?: number, gltfAutoDownload?: boolean, includeAnimations?: boolean): Promise<ThumbnailResult>;
|
|
1557
1610
|
|
|
1611
|
+
export declare function generateOutfitModelThumbnail(auth: Authentication, outfitModel: OutfitModel, options: Partial<OutfitModelThumbnailOptions>): Promise<ThumbnailResult>;
|
|
1612
|
+
|
|
1558
1613
|
/**
|
|
1559
1614
|
* Generates a 2d or 3d thumbnail of an outfit
|
|
1560
1615
|
* @param auth Authentication
|
|
@@ -1565,22 +1620,20 @@ export declare function generateModelThumbnail(auth: Authentication, renderScene
|
|
|
1565
1620
|
* @param gltfAutoDownload Automatically download gltf file
|
|
1566
1621
|
* @returns ThumbnailResult, always a string for 2d thumbnails, 3d can be ArrayBuffer (glb, binary) or {[key: string]: unknown} (gltf, json)
|
|
1567
1622
|
*
|
|
1623
|
+
* @deprecated Use new Thumbnails category instead
|
|
1568
1624
|
* @category ThumbnailGenerator
|
|
1569
1625
|
*
|
|
1570
1626
|
* @example
|
|
1571
1627
|
* **Example on generating 1000x1000 webp thumbnail for blank outfit**
|
|
1572
1628
|
* ```ts
|
|
1573
1629
|
* const outfit = new Outfit()
|
|
1574
|
-
* FLAGS.THUMBNAIL_TIMEOUT = 1 //makes thumbnail generation faster
|
|
1575
|
-
* FLAGS.PARTICLES_START_FULL = 10 //makes emitters appear as if theyve been there for some time (10 seconds)
|
|
1576
1630
|
* FLAGS.RENDERTARGET_TO_CANVASTEXTURE = true //required for gltf export
|
|
1577
1631
|
* const result = await generateOutfitThumbnail(new Authentication(), outfit, [1000,1000], "webp", 0.99)
|
|
1578
1632
|
* FLAGS.RENDERTARGET_TO_CANVASTEXTURE = false
|
|
1579
|
-
* FLAGS.PARTICLES_START_FULL = 0
|
|
1580
1633
|
* console.log(result)
|
|
1581
1634
|
* ```
|
|
1582
1635
|
*/
|
|
1583
|
-
export declare function generateOutfitThumbnail(auth: Authentication, outfit: Outfit, size?: Vec2, type?: ThumbnailType, quality?: number, gltfAutoDownload?: boolean, includeAnimations?: boolean): Promise<ThumbnailResult>;
|
|
1636
|
+
export declare function generateOutfitThumbnail(auth: Authentication, outfit: Outfit, size?: Vec2, type?: ThumbnailType, quality?: number, gltfAutoDownload?: boolean, includeAnimations?: boolean, renderSceneParam?: RBXRendererScene): Promise<ThumbnailResult>;
|
|
1584
1637
|
|
|
1585
1638
|
export declare function generateUUIDv4(): string;
|
|
1586
1639
|
|
|
@@ -1600,6 +1653,7 @@ export declare function getCameraCFrameForAvatarNonCustomized(rig: Instance): CF
|
|
|
1600
1653
|
* @param yRot Customized yRot
|
|
1601
1654
|
* @param distance Customized distanceScale
|
|
1602
1655
|
* @returns Thumbnail camera cframe
|
|
1656
|
+
* @deprecated Use new Thumbnails category instead
|
|
1603
1657
|
* @category ThumbnailGenerator
|
|
1604
1658
|
*/
|
|
1605
1659
|
export declare function getCameraCFrameForHeadshotCustomized(rig: Instance, fov: number, yRot: number, distance: number): CFrame | undefined;
|
|
@@ -1609,18 +1663,21 @@ export declare function getCameraCFrameForHeadshotCustomized(rig: Instance, fov:
|
|
|
1609
1663
|
*/
|
|
1610
1664
|
export declare function getDistIndexArray(ref: FileMesh, dist: FileMesh): (number | undefined)[];
|
|
1611
1665
|
|
|
1612
|
-
|
|
1666
|
+
/**
|
|
1667
|
+
* @category ThumbnailGenerator */
|
|
1613
1668
|
export declare function getExtents(cframe: CFrame, parts: Instance[]): [Vector3, Vector3];
|
|
1614
1669
|
|
|
1615
|
-
|
|
1670
|
+
/**
|
|
1671
|
+
* @category ThumbnailGenerator */
|
|
1616
1672
|
export declare function getExtentsCenter(extents: [Vector3, Vector3]): Vector3;
|
|
1617
1673
|
|
|
1618
1674
|
/**
|
|
1619
|
-
* @deprecated this is SO broken
|
|
1620
1675
|
* @category ThumbnailGenerator
|
|
1621
1676
|
* */
|
|
1622
1677
|
export declare function getExtentsForParts(parts: Instance[], includeTransform?: boolean): [Vector3, Vector3];
|
|
1623
1678
|
|
|
1679
|
+
export declare function getExtentsWorld(rig: Instance): [Vector3, Vector3];
|
|
1680
|
+
|
|
1624
1681
|
export declare function getHeadExtents(rig: Instance): [Vector3, Vector3] | undefined;
|
|
1625
1682
|
|
|
1626
1683
|
/**@category API */
|
|
@@ -1652,8 +1709,6 @@ export declare function getPartsInAssembly_Generate(part: Instance): Instance[];
|
|
|
1652
1709
|
|
|
1653
1710
|
export declare function getRandomBetweenInclusive(min: number, max: number, randomVal?: number): number;
|
|
1654
1711
|
|
|
1655
|
-
export declare function getRigExtentsWorld(rig: Instance): [Vector3, Vector3];
|
|
1656
|
-
|
|
1657
1712
|
export declare function getRootAssemblyPart_Generate(part: Instance): Instance;
|
|
1658
1713
|
|
|
1659
1714
|
/**@category API */
|
|
@@ -1678,7 +1733,7 @@ export declare interface GetSubscription_Result {
|
|
|
1678
1733
|
* @returns Thumbnail camera cframe
|
|
1679
1734
|
* @category ThumbnailGenerator
|
|
1680
1735
|
*/
|
|
1681
|
-
export declare function getThumbnailCameraCFrame(model: Instance): CFrame | undefined;
|
|
1736
|
+
export declare function getThumbnailCameraCFrame(model: Instance, fov: number, forceAngle?: Vec3): CFrame | undefined;
|
|
1682
1737
|
|
|
1683
1738
|
/**@category API */
|
|
1684
1739
|
export declare interface GetTopics_Payload {
|
|
@@ -1865,6 +1920,31 @@ export declare const HumanoidRigType: {
|
|
|
1865
1920
|
R15: number;
|
|
1866
1921
|
};
|
|
1867
1922
|
|
|
1923
|
+
/**
|
|
1924
|
+
* Renders a scene to an image and returns a data url
|
|
1925
|
+
* @param renderScene Scene that will be rendered
|
|
1926
|
+
* @param width Width in pixels
|
|
1927
|
+
* @param height Height in pixels
|
|
1928
|
+
* @param format Type of image
|
|
1929
|
+
* @param options
|
|
1930
|
+
* @returns data url
|
|
1931
|
+
*
|
|
1932
|
+
* @category ThumbnailGenerator
|
|
1933
|
+
*/
|
|
1934
|
+
export declare function imageThumbnailClick(renderScene: RBXRendererScene, width: number, height: number, format: ImageThumbnailFormat, options?: Partial<ImageThumbnailOptions>): Promise<string | undefined>;
|
|
1935
|
+
|
|
1936
|
+
/**
|
|
1937
|
+
* @category ThumbnailGenerator
|
|
1938
|
+
*/
|
|
1939
|
+
export declare type ImageThumbnailFormat = "png" | "webp" | "jpeg";
|
|
1940
|
+
|
|
1941
|
+
/**
|
|
1942
|
+
* @category ThumbnailGenerator
|
|
1943
|
+
*/
|
|
1944
|
+
export declare interface ImageThumbnailOptions {
|
|
1945
|
+
quality: number;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1868
1948
|
export declare function imageUrlToDataUrl(imageUrl: string): Promise<string>;
|
|
1869
1949
|
|
|
1870
1950
|
/**
|
|
@@ -2158,11 +2238,16 @@ export declare class LocalOutfit {
|
|
|
2158
2238
|
date: number;
|
|
2159
2239
|
image?: string;
|
|
2160
2240
|
buffer: string;
|
|
2241
|
+
bg: number;
|
|
2161
2242
|
constructor(outfit: Outfit);
|
|
2162
2243
|
toJson(): LocalOutfitJson;
|
|
2163
2244
|
fromJson(data: LocalOutfitJson): this;
|
|
2164
2245
|
update(outfit: Outfit): void;
|
|
2246
|
+
/**
|
|
2247
|
+
* @deprecated Use toOutfitModel() instead
|
|
2248
|
+
*/
|
|
2165
2249
|
toOutfit(auth: Authentication): Promise<Outfit>;
|
|
2250
|
+
toOutfitModel(auth: Authentication): Promise<OutfitModel>;
|
|
2166
2251
|
}
|
|
2167
2252
|
|
|
2168
2253
|
export declare interface LocalOutfitJson {
|
|
@@ -2172,6 +2257,7 @@ export declare interface LocalOutfitJson {
|
|
|
2172
2257
|
date: number;
|
|
2173
2258
|
image: string | undefined;
|
|
2174
2259
|
buffer: string;
|
|
2260
|
+
bg?: number;
|
|
2175
2261
|
}
|
|
2176
2262
|
|
|
2177
2263
|
/**
|
|
@@ -2414,6 +2500,31 @@ export declare const minimumDeltaEBodyColorDifference = 11.4;
|
|
|
2414
2500
|
*/
|
|
2415
2501
|
export declare function minus(v0: Vec3, v1: Vec3): Vec3;
|
|
2416
2502
|
|
|
2503
|
+
/**
|
|
2504
|
+
* Generates a 3D model from the scene
|
|
2505
|
+
* @param renderScene Scene that will be rendered
|
|
2506
|
+
* @param format Format of resulting model
|
|
2507
|
+
* @param options
|
|
2508
|
+
* @returns ArrayBuffer for glb or Object for gltf
|
|
2509
|
+
*
|
|
2510
|
+
* @category ThumbnailGenerator
|
|
2511
|
+
*/
|
|
2512
|
+
export declare function modelThumbnailClick(renderScene: RBXRendererScene, format: ModelThumbnailFormat, options?: Partial<ModelThumbnailOptions>): Promise<ArrayBuffer | {
|
|
2513
|
+
[key: string]: unknown;
|
|
2514
|
+
}>;
|
|
2515
|
+
|
|
2516
|
+
/**
|
|
2517
|
+
* @category ThumbnailGenerator
|
|
2518
|
+
*/
|
|
2519
|
+
export declare type ModelThumbnailFormat = "gltf" | "glb";
|
|
2520
|
+
|
|
2521
|
+
/**
|
|
2522
|
+
* @category ThumbnailGenerator
|
|
2523
|
+
*/
|
|
2524
|
+
export declare interface ModelThumbnailOptions {
|
|
2525
|
+
includeAnimations: boolean;
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2417
2528
|
/**
|
|
2418
2529
|
* @category InstanceWrapper
|
|
2419
2530
|
*/
|
|
@@ -2660,6 +2771,7 @@ export declare class Outfit {
|
|
|
2660
2771
|
clone(): Outfit;
|
|
2661
2772
|
toJson(removeNotOwnedAssets?: boolean): OutfitJson;
|
|
2662
2773
|
toCleanJson(removeNotOwnedAssets?: boolean): OutfitJson;
|
|
2774
|
+
toCleanJsonV4(removeNotOwnedAssets?: boolean): OutfitJson;
|
|
2663
2775
|
fromJson(outfitJson: OutfitJson): void;
|
|
2664
2776
|
/**
|
|
2665
2777
|
* @deprecated Incorrect, use getValidationIssues() instead
|
|
@@ -2715,6 +2827,29 @@ export declare type OutfitJson = {
|
|
|
2715
2827
|
scales?: ScaleJson;
|
|
2716
2828
|
};
|
|
2717
2829
|
|
|
2830
|
+
export declare class OutfitModel {
|
|
2831
|
+
outfit: Outfit;
|
|
2832
|
+
emotes: Map<number, Asset>;
|
|
2833
|
+
background?: Asset;
|
|
2834
|
+
thumbnailCustomizations?: ThumbnailCustomization[];
|
|
2835
|
+
profileFrame: undefined;
|
|
2836
|
+
fromJson(outfitModel: AvatarModel_Result | OutfitModel_Result): OutfitModel;
|
|
2837
|
+
clone(): OutfitModel;
|
|
2838
|
+
}
|
|
2839
|
+
|
|
2840
|
+
export declare interface OutfitModel_Result {
|
|
2841
|
+
outfitModel: OutfitJson;
|
|
2842
|
+
outfitConfigurations: AvatarConfigurations | null;
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2845
|
+
export declare type OutfitModelThumbnailOptions = {
|
|
2846
|
+
size: Vec2;
|
|
2847
|
+
type: ThumbnailType;
|
|
2848
|
+
quality: number;
|
|
2849
|
+
gltfAutoDownload: boolean;
|
|
2850
|
+
includeAnimations: boolean;
|
|
2851
|
+
};
|
|
2852
|
+
|
|
2718
2853
|
/** @category Outfit */
|
|
2719
2854
|
export declare type OutfitOrigin = "WebAvatar" | "WebOutfit" | "Other" | "Look";
|
|
2720
2855
|
|
|
@@ -2725,6 +2860,37 @@ export declare const OutfitOrigin: {
|
|
|
2725
2860
|
|
|
2726
2861
|
/**
|
|
2727
2862
|
* @category Renderer
|
|
2863
|
+
* @example
|
|
2864
|
+
* **Example on usage**
|
|
2865
|
+
* ```ts
|
|
2866
|
+
* const auth = new Authentication()
|
|
2867
|
+
* const outfit = new Outfit()
|
|
2868
|
+
* const renderScene = RBXRenderer.addScene()
|
|
2869
|
+
*
|
|
2870
|
+
* const outfitRenderer = new OutfitRenderer(auth, outfit, renderScene)
|
|
2871
|
+
* outfitRenderer.startAnimating()
|
|
2872
|
+
* outfitRenderer.setMainAnimation("anim.1234") //animation with id 1234, check documentation for other possible values
|
|
2873
|
+
*
|
|
2874
|
+
* outfitRenderer.onRenderSuccess.Connect(() => {
|
|
2875
|
+
* //handle Instance tree + renderDesc being successfuly
|
|
2876
|
+
* })
|
|
2877
|
+
* outfitRenderer.onError.Connect(() => {
|
|
2878
|
+
* //handle Instance tree error
|
|
2879
|
+
* })
|
|
2880
|
+
* outfitRenderer.onRenderError.Connect(() => {
|
|
2881
|
+
* //handle renderDesc error
|
|
2882
|
+
* })
|
|
2883
|
+
*
|
|
2884
|
+
* //onRenderSuccess is fired once after some time
|
|
2885
|
+
*
|
|
2886
|
+
* outfitRenderer.setOutfit(new Outfit())
|
|
2887
|
+
*
|
|
2888
|
+
* //onRenderSuccess is fired again once after some time
|
|
2889
|
+
*
|
|
2890
|
+
* //when we're done rendering
|
|
2891
|
+
* outfitRenderer.destroy()
|
|
2892
|
+
* renderScene.destroy()
|
|
2893
|
+
* ```
|
|
2728
2894
|
*/
|
|
2729
2895
|
export declare class OutfitRenderer {
|
|
2730
2896
|
auth: Authentication;
|
|
@@ -2734,6 +2900,7 @@ export declare class OutfitRenderer {
|
|
|
2734
2900
|
doCameraUpdateOnLoad: boolean; /**Makes camera update when new avatar has loaded */
|
|
2735
2901
|
doCameraUpdate: boolean; /**Does camera update every frame */
|
|
2736
2902
|
doAddInstance: boolean; /**If outfitRenderer should call RBXRenderer.addInstance() */
|
|
2903
|
+
forceAnimationLoop: boolean; /**If future loaded animations should be set to loop */
|
|
2737
2904
|
currentlyChangingRig: boolean;
|
|
2738
2905
|
currentlyUpdating: boolean;
|
|
2739
2906
|
hasNewUpdate: boolean;
|
|
@@ -2743,14 +2910,34 @@ export declare class OutfitRenderer {
|
|
|
2743
2910
|
animationFPS: number;
|
|
2744
2911
|
deltaTimeMultiplier: number;
|
|
2745
2912
|
renderScene: RBXRendererScene;
|
|
2746
|
-
|
|
2913
|
+
private _renderSceneCompiledConnection?;
|
|
2914
|
+
private _renderSceneFailedConnection?;
|
|
2915
|
+
/**Event is fired if a new outfit failed to load (specifically the Instance tree, not the rendering part)
|
|
2916
|
+
*
|
|
2917
|
+
* Simple: Fired when, Instance tree = fail
|
|
2747
2918
|
* @returns OutfitRendererErrorType
|
|
2748
2919
|
*/
|
|
2749
2920
|
onError: Event_2;
|
|
2750
|
-
/**Event is fired if a new outfit successfully loaded
|
|
2921
|
+
/**Event is fired if a new outfit successfully loaded (specifically the Instance tree, not the rendering part)
|
|
2922
|
+
*
|
|
2923
|
+
* Simple: Fired when, Instance tree = done
|
|
2751
2924
|
* @returns void
|
|
2752
2925
|
*/
|
|
2753
2926
|
onSuccess: Event_2;
|
|
2927
|
+
/**Event is fired when all the renderDescs have been compiled, if any renderDescs fail to render this wil never be fired (can only be fired after Instance tree is done)
|
|
2928
|
+
*
|
|
2929
|
+
* Simple: Fired when, Instance tree = done & Rendering = done (AKA everything)
|
|
2930
|
+
*
|
|
2931
|
+
* NOTE: If FLAGS.LAYERED_CLOTHING_COOLDOWN > 0 (non-default), this may be fired too early and later fire again
|
|
2932
|
+
* @returns void
|
|
2933
|
+
*/
|
|
2934
|
+
onRenderSuccess: Event_2;
|
|
2935
|
+
/**Event is fired if a renderDesc fails to compile, it can be fired multiple times
|
|
2936
|
+
*
|
|
2937
|
+
* Simple: Fired when, Rendering = fail
|
|
2938
|
+
* @returns void
|
|
2939
|
+
*/
|
|
2940
|
+
onRenderError: Event_2;
|
|
2754
2941
|
/**
|
|
2755
2942
|
* Creates a new OutfitRenderer which makes it easy to render outfits
|
|
2756
2943
|
* @param auth The authentication object, you should have one you use for everything
|
|
@@ -2761,7 +2948,7 @@ export declare class OutfitRenderer {
|
|
|
2761
2948
|
/**
|
|
2762
2949
|
* Updates the current rig, called internally by _updateOutfit()
|
|
2763
2950
|
*/
|
|
2764
|
-
_setRigTo(newRigType: AvatarType): Promise<
|
|
2951
|
+
_setRigTo(newRigType: AvatarType): Promise<Instance | Response>;
|
|
2765
2952
|
/**
|
|
2766
2953
|
* Rerenders the current outfit, called internally by setOutfit() and constructor
|
|
2767
2954
|
*/
|
|
@@ -2788,11 +2975,22 @@ export declare class OutfitRenderer {
|
|
|
2788
2975
|
stopAnimating(): void;
|
|
2789
2976
|
/**
|
|
2790
2977
|
* Sets the current animation being played
|
|
2791
|
-
* @param name The name of the animation, for example "idle", "run" or "
|
|
2978
|
+
* @param name The name of the animation, for example "idle", "run", "emote.1234" or "anim.1234"
|
|
2792
2979
|
* @returns If the animation started playing, it may start playing later if it has been queued despite returning false
|
|
2793
2980
|
*/
|
|
2794
2981
|
setMainAnimation(name: string): Promise<boolean>;
|
|
2795
|
-
|
|
2982
|
+
fireFullyRenderedIfNeeded(): void;
|
|
2983
|
+
/**
|
|
2984
|
+
* Prepares the OutfitRenderer to be used for a thumbnail, call IMMEDIATELY after creating the OutfitRenderer
|
|
2985
|
+
* @returns true on success
|
|
2986
|
+
*/
|
|
2987
|
+
prepareForThumbnail(): Promise<boolean>;
|
|
2988
|
+
private _prepareForThumbnail;
|
|
2989
|
+
/**
|
|
2990
|
+
* Updates rendered particles so they face the camera without simulating them (usually used when generating thumbnails)
|
|
2991
|
+
*/
|
|
2992
|
+
updateParticleMatrix(): void;
|
|
2993
|
+
/**Calls destroy on the rig, stops animating and disconnects connections. The OutfitRenderer should not be interacted with after this */
|
|
2796
2994
|
destroy(): void;
|
|
2797
2995
|
}
|
|
2798
2996
|
|
|
@@ -3175,9 +3373,15 @@ export declare class RBXRendererScene {
|
|
|
3175
3373
|
effectComposer: EffectComposer | undefined;
|
|
3176
3374
|
scissor?: [number, number, number, number];
|
|
3177
3375
|
viewport?: [number, number, number, number];
|
|
3376
|
+
addedInstances: Instance[];
|
|
3178
3377
|
isRenderingMesh: Map<Instance, boolean>;
|
|
3179
3378
|
renderDescs: Map<Instance, RenderDesc>;
|
|
3180
3379
|
destroyConnections: Map<Instance, Connection>;
|
|
3380
|
+
compiledRenderDesc: Event_2;
|
|
3381
|
+
failedRenderDesc: Event_2;
|
|
3382
|
+
forceAccurateNeedsRegeneration: boolean;
|
|
3383
|
+
particlesStartFull?: number;
|
|
3384
|
+
particlesStartFullFramerate: number;
|
|
3181
3385
|
lookAwayVector: Vec3;
|
|
3182
3386
|
lookAwayDistance: number;
|
|
3183
3387
|
shadowEnabled: boolean;
|
|
@@ -3196,6 +3400,16 @@ export declare class RBXRendererScene {
|
|
|
3196
3400
|
noRect(): void;
|
|
3197
3401
|
/** Destroys all renderDescs but does not call Destroy on instances */
|
|
3198
3402
|
destroy(): void;
|
|
3403
|
+
/**
|
|
3404
|
+
* Checks that renderDescs for provided instances are compiled, ignores instances that shouldn't be compiled or haven't been added
|
|
3405
|
+
* @returns true if all provided instances's renderDescs have been compiled
|
|
3406
|
+
*/
|
|
3407
|
+
areInstancesCompiled(instances: Instance[]): boolean;
|
|
3408
|
+
/**
|
|
3409
|
+
* Checks that all renderDescs are compiled
|
|
3410
|
+
* @return true if all have been compiled
|
|
3411
|
+
*/
|
|
3412
|
+
isFullyCompiled(): boolean;
|
|
3199
3413
|
/**
|
|
3200
3414
|
* Exports scene as a GLTF or GLB
|
|
3201
3415
|
* @param name Name of the resulting file if autoDownload is true
|
|
@@ -3255,6 +3469,8 @@ declare class RenderDesc extends DisposableDesc {
|
|
|
3255
3469
|
renderScene: RBXRendererScene;
|
|
3256
3470
|
results?: THREE.Object3D[];
|
|
3257
3471
|
instance?: Instance;
|
|
3472
|
+
compiled: boolean;
|
|
3473
|
+
failed: boolean;
|
|
3258
3474
|
constructor(renderScene: RBXRendererScene);
|
|
3259
3475
|
isSame(_other: RenderDesc): boolean;
|
|
3260
3476
|
needsRegeneration(_other: RenderDesc): boolean;
|
|
@@ -3564,6 +3780,18 @@ export declare const StringBufferProperties: string[];
|
|
|
3564
3780
|
|
|
3565
3781
|
declare type ThreePoseCorrective = Vec3;
|
|
3566
3782
|
|
|
3783
|
+
export declare class ThumbnailCustomization {
|
|
3784
|
+
thumbnailType: number;
|
|
3785
|
+
emoteAssetId: number;
|
|
3786
|
+
fieldOfViewDeg: number;
|
|
3787
|
+
yRotDeg: number;
|
|
3788
|
+
distanceScale: number;
|
|
3789
|
+
constructor(thumbnailType: number);
|
|
3790
|
+
fromJson(json: ThumbnailsCustomization_Payload): this;
|
|
3791
|
+
toJson(): ThumbnailsCustomization_Payload;
|
|
3792
|
+
clone(): ThumbnailCustomization;
|
|
3793
|
+
}
|
|
3794
|
+
|
|
3567
3795
|
/**@category API */
|
|
3568
3796
|
export declare interface ThumbnailCustomizations_Result {
|
|
3569
3797
|
"avatarThumbnailCustomizations": {
|
|
@@ -3577,7 +3805,9 @@ export declare interface ThumbnailCustomizations_Result {
|
|
|
3577
3805
|
}[];
|
|
3578
3806
|
}
|
|
3579
3807
|
|
|
3580
|
-
|
|
3808
|
+
/**
|
|
3809
|
+
* @deprecated Use new Thumbnails category instead
|
|
3810
|
+
* @category ThumbnailGenerator */
|
|
3581
3811
|
export declare type ThumbnailResult = ArrayBuffer | {
|
|
3582
3812
|
[key: string]: unknown;
|
|
3583
3813
|
} | string | undefined;
|
|
@@ -3593,7 +3823,9 @@ export declare interface ThumbnailsCustomization_Payload {
|
|
|
3593
3823
|
};
|
|
3594
3824
|
}
|
|
3595
3825
|
|
|
3596
|
-
|
|
3826
|
+
/**
|
|
3827
|
+
* @deprecated Use new Thumbnails category instead
|
|
3828
|
+
* @category ThumbnailGenerator */
|
|
3597
3829
|
export declare type ThumbnailType = "png" | "webp" | "gltf" | "glb";
|
|
3598
3830
|
|
|
3599
3831
|
/**
|
|
@@ -3822,8 +4054,6 @@ export declare const WrapLayerAutoSkin: {
|
|
|
3822
4054
|
|
|
3823
4055
|
export declare const xmlMagic = "<roblox ";
|
|
3824
4056
|
|
|
3825
|
-
export declare function zoomExtents(cameraCFrame: CFrame, modelCFrame: CFrame, modelSize: Vector3, targetFOV: number, distanceScale: number, sizeType?: ZoomExtentsSizeType): void;
|
|
3826
|
-
|
|
3827
4057
|
/**
|
|
3828
4058
|
* Makes model fit inside camera
|
|
3829
4059
|
* @param cameraCFrame Original camera cframe
|
|
@@ -3833,6 +4063,8 @@ export declare function zoomExtents(cameraCFrame: CFrame, modelCFrame: CFrame, m
|
|
|
3833
4063
|
* @param distanceScale Distance is multiplied by this
|
|
3834
4064
|
* @category ThumbnailGenerator
|
|
3835
4065
|
*/
|
|
4066
|
+
export declare function zoomExtents(cameraCFrame: CFrame, modelCFrame: CFrame, modelSize: Vector3, targetFOV: number, distanceScale: number, sizeType?: ZoomExtentsSizeType): void;
|
|
4067
|
+
|
|
3836
4068
|
export declare type ZoomExtentsSizeType = "largestAxis" | "calculate";
|
|
3837
4069
|
|
|
3838
4070
|
/**
|