roavatar-renderer 1.5.16 → 1.5.18

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +122 -16
  2. package/dist/index.js +913 -353
  3. 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<NavigationMenuItems | Response>;
349
- GetTopics: (auth: Authentication, body: GetTopics_Payload) => Promise<GetTopics_Result | Response>;
350
- Search: ({ taxonomy, salesTypeFilter, sortType, categoryFilter, keyword, topics, creatorName, minPrice, maxPrice, includeNotForSale, limit }: Search_Payload, cursor?: string) => Promise<Search_Result | Response>;
351
- GetBundleDetails: (bundleId: number | string) => Promise<BundleDetails_Result | Response>;
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<ItemDetails_Result | Response>;
356
- GetMarketplaceWidgetsSearch: (query: string) => Promise<MarketplaceWidgets_Result | Response>;
357
- GetMarketplaceWidgets: (context?: string) => Promise<MarketplaceWidgets_Result | Response>;
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<GetInfoForId_Result | Response>;
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";
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;
@@ -1527,6 +1573,7 @@ export declare function gaussian_rbf(v0: Vec3, v1: Vec3, sigma?: number): number
1527
1573
  * @param gltfAutoDownload Automatically download gltf file
1528
1574
  * @returns ThumbnailResult, always a string for 2d thumbnails, 3d can be ArrayBuffer (glb, binary) or {[key: string]: unknown} (gltf, json)
1529
1575
  *
1576
+ * @deprecated Use new Thumbnails category instead
1530
1577
  * @category ThumbnailGenerator
1531
1578
  *
1532
1579
  * @example
@@ -1555,6 +1602,8 @@ export declare function gaussian_rbf(v0: Vec3, v1: Vec3, sigma?: number): number
1555
1602
  */
1556
1603
  export declare function generateModelThumbnail(auth: Authentication, renderScene: RBXRendererScene, model: Instance, size?: Vec2, type?: ThumbnailType, quality?: number, gltfAutoDownload?: boolean, includeAnimations?: boolean): Promise<ThumbnailResult>;
1557
1604
 
1605
+ export declare function generateOutfitModelThumbnail(auth: Authentication, outfitModel: OutfitModel, options: Partial<OutfitModelThumbnailOptions>): Promise<ThumbnailResult>;
1606
+
1558
1607
  /**
1559
1608
  * Generates a 2d or 3d thumbnail of an outfit
1560
1609
  * @param auth Authentication
@@ -1565,6 +1614,7 @@ export declare function generateModelThumbnail(auth: Authentication, renderScene
1565
1614
  * @param gltfAutoDownload Automatically download gltf file
1566
1615
  * @returns ThumbnailResult, always a string for 2d thumbnails, 3d can be ArrayBuffer (glb, binary) or {[key: string]: unknown} (gltf, json)
1567
1616
  *
1617
+ * @deprecated Use new Thumbnails category instead
1568
1618
  * @category ThumbnailGenerator
1569
1619
  *
1570
1620
  * @example
@@ -1580,7 +1630,7 @@ export declare function generateModelThumbnail(auth: Authentication, renderScene
1580
1630
  * console.log(result)
1581
1631
  * ```
1582
1632
  */
1583
- export declare function generateOutfitThumbnail(auth: Authentication, outfit: Outfit, size?: Vec2, type?: ThumbnailType, quality?: number, gltfAutoDownload?: boolean, includeAnimations?: boolean): Promise<ThumbnailResult>;
1633
+ export declare function generateOutfitThumbnail(auth: Authentication, outfit: Outfit, size?: Vec2, type?: ThumbnailType, quality?: number, gltfAutoDownload?: boolean, includeAnimations?: boolean, renderSceneParam?: RBXRendererScene): Promise<ThumbnailResult>;
1584
1634
 
1585
1635
  export declare function generateUUIDv4(): string;
1586
1636
 
@@ -1600,6 +1650,7 @@ export declare function getCameraCFrameForAvatarNonCustomized(rig: Instance): CF
1600
1650
  * @param yRot Customized yRot
1601
1651
  * @param distance Customized distanceScale
1602
1652
  * @returns Thumbnail camera cframe
1653
+ * @deprecated Use new Thumbnails category instead
1603
1654
  * @category ThumbnailGenerator
1604
1655
  */
1605
1656
  export declare function getCameraCFrameForHeadshotCustomized(rig: Instance, fov: number, yRot: number, distance: number): CFrame | undefined;
@@ -1609,14 +1660,18 @@ export declare function getCameraCFrameForHeadshotCustomized(rig: Instance, fov:
1609
1660
  */
1610
1661
  export declare function getDistIndexArray(ref: FileMesh, dist: FileMesh): (number | undefined)[];
1611
1662
 
1612
- /**@category ThumbnailGenerator */
1663
+ /**
1664
+ * @deprecated Use new Thumbnails category instead
1665
+ * @category ThumbnailGenerator */
1613
1666
  export declare function getExtents(cframe: CFrame, parts: Instance[]): [Vector3, Vector3];
1614
1667
 
1615
- /**@category ThumbnailGenerator */
1668
+ /**
1669
+ * @deprecated Use new Thumbnails category instead
1670
+ * @category ThumbnailGenerator */
1616
1671
  export declare function getExtentsCenter(extents: [Vector3, Vector3]): Vector3;
1617
1672
 
1618
1673
  /**
1619
- * @deprecated this is SO broken
1674
+ * @deprecated Use new Thumbnails category instead
1620
1675
  * @category ThumbnailGenerator
1621
1676
  * */
1622
1677
  export declare function getExtentsForParts(parts: Instance[], includeTransform?: boolean): [Vector3, Vector3];
@@ -1676,9 +1731,10 @@ export declare interface GetSubscription_Result {
1676
1731
  * Calculates the CFrame the camera should be at when generating a thumbnail
1677
1732
  * @param model The model-like instance to get thumbnail camera for
1678
1733
  * @returns Thumbnail camera cframe
1734
+ * @deprecated Use new Thumbnails category instead
1679
1735
  * @category ThumbnailGenerator
1680
1736
  */
1681
- export declare function getThumbnailCameraCFrame(model: Instance): CFrame | undefined;
1737
+ export declare function getThumbnailCameraCFrame(model: Instance, fov: number, forceAngle?: Vec3): CFrame | undefined;
1682
1738
 
1683
1739
  /**@category API */
1684
1740
  export declare interface GetTopics_Payload {
@@ -1919,6 +1975,7 @@ export declare class Instance {
1919
1975
  get id(): string;
1920
1976
  set name(value: string);
1921
1977
  get name(): string;
1978
+ get Parent(): Instance | undefined;
1922
1979
  createWrapper(): InstanceWrapper | undefined;
1923
1980
  get w(): InstanceWrapper | undefined;
1924
1981
  addConnectionReference(connection: Connection): void;
@@ -2157,11 +2214,16 @@ export declare class LocalOutfit {
2157
2214
  date: number;
2158
2215
  image?: string;
2159
2216
  buffer: string;
2217
+ bg: number;
2160
2218
  constructor(outfit: Outfit);
2161
2219
  toJson(): LocalOutfitJson;
2162
2220
  fromJson(data: LocalOutfitJson): this;
2163
2221
  update(outfit: Outfit): void;
2222
+ /**
2223
+ * @deprecated Use toOutfitModel() instead
2224
+ */
2164
2225
  toOutfit(auth: Authentication): Promise<Outfit>;
2226
+ toOutfitModel(auth: Authentication): Promise<OutfitModel>;
2165
2227
  }
2166
2228
 
2167
2229
  export declare interface LocalOutfitJson {
@@ -2171,6 +2233,7 @@ export declare interface LocalOutfitJson {
2171
2233
  date: number;
2172
2234
  image: string | undefined;
2173
2235
  buffer: string;
2236
+ bg?: number;
2174
2237
  }
2175
2238
 
2176
2239
  /**
@@ -2659,6 +2722,7 @@ export declare class Outfit {
2659
2722
  clone(): Outfit;
2660
2723
  toJson(removeNotOwnedAssets?: boolean): OutfitJson;
2661
2724
  toCleanJson(removeNotOwnedAssets?: boolean): OutfitJson;
2725
+ toCleanJsonV4(removeNotOwnedAssets?: boolean): OutfitJson;
2662
2726
  fromJson(outfitJson: OutfitJson): void;
2663
2727
  /**
2664
2728
  * @deprecated Incorrect, use getValidationIssues() instead
@@ -2714,6 +2778,29 @@ export declare type OutfitJson = {
2714
2778
  scales?: ScaleJson;
2715
2779
  };
2716
2780
 
2781
+ export declare class OutfitModel {
2782
+ outfit: Outfit;
2783
+ emotes: Map<number, Asset>;
2784
+ background?: Asset;
2785
+ thumbnailCustomizations?: ThumbnailCustomization[];
2786
+ profileFrame: undefined;
2787
+ fromJson(outfitModel: AvatarModel_Result | OutfitModel_Result): OutfitModel;
2788
+ clone(): OutfitModel;
2789
+ }
2790
+
2791
+ export declare interface OutfitModel_Result {
2792
+ outfitModel: OutfitJson;
2793
+ outfitConfigurations: AvatarConfigurations | null;
2794
+ }
2795
+
2796
+ export declare type OutfitModelThumbnailOptions = {
2797
+ size: Vec2;
2798
+ type: ThumbnailType;
2799
+ quality: number;
2800
+ gltfAutoDownload: boolean;
2801
+ includeAnimations: boolean;
2802
+ };
2803
+
2717
2804
  /** @category Outfit */
2718
2805
  export declare type OutfitOrigin = "WebAvatar" | "WebOutfit" | "Other" | "Look";
2719
2806
 
@@ -2760,7 +2847,7 @@ export declare class OutfitRenderer {
2760
2847
  /**
2761
2848
  * Updates the current rig, called internally by _updateOutfit()
2762
2849
  */
2763
- _setRigTo(newRigType: AvatarType): Promise<Response | Instance>;
2850
+ _setRigTo(newRigType: AvatarType): Promise<Instance | Response>;
2764
2851
  /**
2765
2852
  * Rerenders the current outfit, called internally by setOutfit() and constructor
2766
2853
  */
@@ -3127,6 +3214,7 @@ export declare class RBXRenderer {
3127
3214
  static _createEffectComposer(renderScene?: RBXRendererScene): void;
3128
3215
  /**Removes an instance from the renderer */
3129
3216
  static removeInstance(instance: Instance, renderScene?: RBXRendererScene): void;
3217
+ static getRenderDescs(instance: Instance): RenderDesc[];
3130
3218
  private static _addRenderDesc;
3131
3219
  /**Adds an instance to the renderer or updates it */
3132
3220
  static addInstance(instance: Instance, auth: Authentication, renderScene?: RBXRendererScene): void;
@@ -3391,6 +3479,7 @@ export declare class ScriptWrapper extends InstanceWrapper {
3391
3479
  created(): void;
3392
3480
  Run(): void;
3393
3481
  SoundPlayer(script: Instance): Promise<void>;
3482
+ HatScript20(script: Instance): Promise<void>;
3394
3483
  }
3395
3484
 
3396
3485
  declare class ScriptWrapperData {
@@ -3455,6 +3544,7 @@ export declare interface Search_Result {
3455
3544
  * Gives a scene the default appearance for thumbnails
3456
3545
  * @param renderScene RBXRenderScene to setup
3457
3546
  *
3547
+ * @deprecated Use new Thumbnails category instead
3458
3548
  * @category ThumbnailGenerator
3459
3549
  */
3460
3550
  export declare function setupThumbnailScene(renderScene: RBXRendererScene): void;
@@ -3561,6 +3651,18 @@ export declare const StringBufferProperties: string[];
3561
3651
 
3562
3652
  declare type ThreePoseCorrective = Vec3;
3563
3653
 
3654
+ export declare class ThumbnailCustomization {
3655
+ thumbnailType: number;
3656
+ emoteAssetId: number;
3657
+ fieldOfViewDeg: number;
3658
+ yRotDeg: number;
3659
+ distanceScale: number;
3660
+ constructor(thumbnailType: number);
3661
+ fromJson(json: ThumbnailsCustomization_Payload): this;
3662
+ toJson(): ThumbnailsCustomization_Payload;
3663
+ clone(): ThumbnailCustomization;
3664
+ }
3665
+
3564
3666
  /**@category API */
3565
3667
  export declare interface ThumbnailCustomizations_Result {
3566
3668
  "avatarThumbnailCustomizations": {
@@ -3574,7 +3676,9 @@ export declare interface ThumbnailCustomizations_Result {
3574
3676
  }[];
3575
3677
  }
3576
3678
 
3577
- /**@category ThumbnailGenerator */
3679
+ /**
3680
+ * @deprecated Use new Thumbnails category instead
3681
+ * @category ThumbnailGenerator */
3578
3682
  export declare type ThumbnailResult = ArrayBuffer | {
3579
3683
  [key: string]: unknown;
3580
3684
  } | string | undefined;
@@ -3590,7 +3694,9 @@ export declare interface ThumbnailsCustomization_Payload {
3590
3694
  };
3591
3695
  }
3592
3696
 
3593
- /**@category ThumbnailGenerator */
3697
+ /**
3698
+ * @deprecated Use new Thumbnails category instead
3699
+ * @category ThumbnailGenerator */
3594
3700
  export declare type ThumbnailType = "png" | "webp" | "gltf" | "glb";
3595
3701
 
3596
3702
  /**