roavatar-renderer 1.2.9 → 1.2.11

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/README.md CHANGED
@@ -5,7 +5,7 @@ It was originally a part of that repository but has now gained independence
5
5
 
6
6
  Also available on npm: https://www.npmjs.com/package/roavatar-renderer
7
7
 
8
- IMPORTANT: Assets are NOT included in the npm module or this repository, you have to get them from the main RoAvatar repository
8
+ IMPORTANT: Assets are NOT included in the npm module or this repository, you have to get them from the main RoAvatar repository OR set FLAGS.ONLINE_ASSETS = true
9
9
 
10
10
  Basic example on how to load an avatar, that is also untested:
11
11
  ```html
@@ -14,8 +14,13 @@ Basic example on how to load an avatar, that is also untested:
14
14
  ```
15
15
  ```ts
16
16
  //setup flags that are compatible with you environment
17
- //path to asset files from RoAvatar
18
- FLAGS.ASSETS_PATH = chrome.runtime.getURL("assets/rbxasset/")
17
+ FLAGS.ONLINE_ASSETS = false //set this to true if you want assets to be loaded from roblox instead of locally
18
+
19
+ if (!FLAGS.ONLINE_ASSETS) {
20
+ //path to asset files from RoAvatar
21
+ FLAGS.ASSETS_PATH = chrome.runtime.getURL("assets/rbxasset/")
22
+ FLAGS.RIG_PATH = chrome.runtime.getURL("assets/")
23
+ }
19
24
  //if layered assets dont work set this to false (workers improve performance)
20
25
  FLAGS.USE_WORKERS = true
21
26
 
@@ -42,7 +47,7 @@ if (!(outfit instanceof Outfit)) throw new Error("Failed to get outfit")
42
47
  //used by api
43
48
  const auth = new Authentication()
44
49
  //manages outfit rendering for you
45
- const outfitRenderer = new OutfitRenderer(auth, outfit, chrome.runtime.getURL("assets/"))
50
+ const outfitRenderer = new OutfitRenderer(auth, outfit, "roavatar://")
46
51
  outfitRenderer.startAnimating()
47
52
  outfitRenderer.setMainAnimation("idle")
48
53
  ```
package/dist/index.d.ts CHANGED
@@ -111,6 +111,7 @@ export declare class AnimationTrack {
111
111
  priority: number;
112
112
  shouldUpdateMotors: boolean;
113
113
  updateFaceControls: boolean;
114
+ animatesParts: boolean;
114
115
  pOriginalWeight: number;
115
116
  pTargetWeight: number;
116
117
  pSpeed: number;
@@ -232,6 +233,7 @@ export declare const API: {
232
233
  UpdateOutfit: (auth: Authentication, outfitId: number | string, newOutfit: Outfit) => Promise<Response>;
233
234
  PatchOutfit: (auth: Authentication, outfitId: number | string, patchData: any) => Promise<Response>;
234
235
  DeleteOutfit: (auth: Authentication, outfitId: number | string) => Promise<Response>;
236
+ GetUserOutfits: (userId: number) => Promise<Response | GetUserOutfits_Result>;
235
237
  GetEmotes: () => Promise<Response>;
236
238
  EquipEmote: (auth: Authentication, assetId: number | string, slot: number) => Promise<Response>;
237
239
  UnequipEmote: (auth: Authentication, slot: number) => Promise<Response>;
@@ -239,6 +241,7 @@ export declare const API: {
239
241
  RedrawThumbnail: (auth: Authentication) => Promise<Response>;
240
242
  GetThumbnailCustomization: () => Promise<Response>;
241
243
  SetThumbnailCustomization: (auth: Authentication, body: ThumbnailsCustomization_Payload) => Promise<Response>;
244
+ ResetThumbnailCustomization: (auth: Authentication, thumbnailType: number) => Promise<Response>;
242
245
  };
243
246
  Asset: {
244
247
  GetAssetBuffer: (url: string, headers?: HeadersInit, extraStr?: string) => Promise<Response | ArrayBuffer>;
@@ -264,11 +267,14 @@ export declare const API: {
264
267
  };
265
268
  Users: {
266
269
  GetUserInfo: () => Promise<UserInfo | undefined>;
270
+ GetIdsFromUsernames: (usernames: string[]) => Promise<any>;
271
+ GetInfoForId: (userId: number) => Promise<GetInfoForId_Result | Response>;
272
+ UserOmniSearch: (query: string, cursor?: string) => Promise<Response | UserOmniSearch_Result>;
267
273
  };
268
274
  Thumbnails: {
269
275
  GetThumbnail: (auth: Authentication, type: string, id: number | string, size?: string, headShape?: string) => Promise<string | undefined>;
270
276
  UncacheThumbnail: (type: string, id: number | string, size?: string, headShape?: string) => void;
271
- RenderOutfit: (auth: Authentication, outfit: Outfit, attempt?: number) => Promise<string | undefined>;
277
+ RenderOutfit: (auth: Authentication, outfit: Outfit, size?: string, thumbnailType?: string, attempt?: number) => Promise<string | undefined>;
272
278
  };
273
279
  LocalOutfit: {
274
280
  GetLocalOutfits: () => Promise<LocalOutfit[]>;
@@ -417,6 +423,8 @@ export declare interface AvatarInventory_Result {
417
423
  };
418
424
  availabilityStatus: string;
419
425
  acquisitionTime: string;
426
+ expirationTime?: string;
427
+ lastEquipTime?: string;
420
428
  headShape?: string;
421
429
  outfitDetail?: {
422
430
  assets: {
@@ -624,7 +632,7 @@ export declare const CatalogBundleTypes: string[];
624
632
  export declare const CategoryDictionary: {
625
633
  [K in string]: {
626
634
  [K in string]: {
627
- [K in string]: SortInfo | SpecialInfo;
635
+ [K in string]: SortInfo | SpecialInfo | SortDivision;
628
636
  };
629
637
  };
630
638
  };
@@ -647,7 +655,7 @@ export declare function clamp(v0: Vec3, lower: Vec3, higher: Vec3): Vec3;
647
655
 
648
656
  export declare function cleanString(inputString: string): string;
649
657
 
650
- export declare function clonePrimitiveArray<T>(arr: T[]): T[];
658
+ export declare function clonePrimitiveArray<T>(arr: T[]): any[];
651
659
 
652
660
  export declare function cloneSearch_Payload(data: Search_Payload): Search_Payload;
653
661
 
@@ -710,6 +718,8 @@ export declare class Content {
710
718
  externalObject?: Instance;
711
719
  }
712
720
 
721
+ export declare const ContentMap: Map<string, string>;
722
+
713
723
  declare class COREMESH {
714
724
  numverts: number;
715
725
  verts: FileMeshVertex[];
@@ -720,6 +730,8 @@ declare class COREMESH {
720
730
  getTouchingVerts(index: number): number[];
721
731
  }
722
732
 
733
+ export declare function createContentMap(): void;
734
+
723
735
  export declare function createMeshChunks(mesh: FileMesh, widthSplit: number, heightSplit: number, depthSplit: number): MeshChunk[];
724
736
 
725
737
  /**THIS FUNCTION IS SO EXPENSIVE IT NEEDS TO BE ASYNC SO JS DOESNT CRASH, USE CHUNKED VERSION INSTEAD
@@ -937,6 +949,7 @@ export declare class FileMeshVertex {
937
949
 
938
950
  export declare const FLAGS: {
939
951
  HAIR_IS_BODYPART: boolean;
952
+ AVATAR_JOINT_UPGRADE: boolean;
940
953
  BODYCOLOR3: boolean;
941
954
  ENABLE_API_CACHE: boolean;
942
955
  ENABLE_API_MESH_CACHE: boolean;
@@ -945,11 +958,15 @@ export declare const FLAGS: {
945
958
  ROAVATAR_TRYON_PLACE: number;
946
959
  ASSETS_PATH: string;
947
960
  ASSETDELIVERY_V2: boolean;
961
+ ONLINE_ASSETS: boolean;
962
+ RIG_PATH: string;
948
963
  USE_WORKERS: boolean;
949
964
  ENABLE_LC_WEIGHT_CACHE: boolean;
950
965
  INFLATE_LAYERED_CLOTHING: number;
951
966
  LAYERED_CLOTHING_ALGORITHM: "linear" | "linearnormal" | "linearnormal2" | "rbf";
952
967
  SHOW_CAGE: boolean;
968
+ LAYERED_CLOTHING_COOLDOWN: number;
969
+ GET_WORKER_FUNC: () => Worker;
953
970
  RBF_PATCH_COUNT: number;
954
971
  RBF_PATCH_DETAIL_SAMPLES: number;
955
972
  RBF_PATCH_SHAPE_SAMPLES: number;
@@ -1005,6 +1022,17 @@ export declare function GetAttachedPart(accessory: Instance, rig: Instance): Ins
1005
1022
 
1006
1023
  export declare function getDistVertArray(ref: FileMesh, dist: FileMesh): (FileMeshVertex | undefined)[];
1007
1024
 
1025
+ export declare interface GetInfoForId_Result {
1026
+ "description": string;
1027
+ "created": string;
1028
+ "isBanned": boolean;
1029
+ "externalAppDisplayName": null;
1030
+ "hasVerifiedBadge": boolean;
1031
+ "id": number;
1032
+ "name": string;
1033
+ "displayName": string;
1034
+ }
1035
+
1008
1036
  export declare function getOffsetArray(inner: FileMesh, outer: FileMesh): ([Vec3, THREE.Quaternion, number] | undefined)[];
1009
1037
 
1010
1038
  export declare function getOffsetMap(inner: FileMesh, outer: FileMesh): Map<number, Vec3>;
@@ -1042,6 +1070,15 @@ export declare interface GetTopics_Result {
1042
1070
  }[];
1043
1071
  }
1044
1072
 
1073
+ export declare interface GetUserOutfits_Result {
1074
+ data: {
1075
+ id: number;
1076
+ name: string;
1077
+ isEditable: boolean;
1078
+ outfitType: string;
1079
+ }[];
1080
+ }
1081
+
1045
1082
  export declare function getUVtoIndexMap(mesh: FileMesh): Map<number, number>;
1046
1083
 
1047
1084
  export declare function getUVtoVertMap(mesh: FileMesh): Map<number, FileMeshVertex[]>;
@@ -1218,7 +1255,6 @@ export declare class Instance {
1218
1255
  Child(name: string): Instance | undefined;
1219
1256
  FindFirstChildOfClass(className: string): Instance | undefined;
1220
1257
  FindLastChildOfClass(className: string): Instance | undefined;
1221
- AccessoryBuildWeld(): void;
1222
1258
  preRender(): void;
1223
1259
  }
1224
1260
 
@@ -1299,11 +1335,14 @@ export declare class ItemInfo {
1299
1335
  id: number | string;
1300
1336
  name: string;
1301
1337
  bundledAssets: number[];
1338
+ creatorId?: number;
1302
1339
  price?: number;
1303
1340
  limitedType?: "Limited" | "LimitedUnique";
1304
1341
  offsale?: boolean;
1305
1342
  supportsHeadShapes?: boolean;
1306
1343
  headShape?: string;
1344
+ expirationTime?: Date;
1345
+ acquisitionTime?: Date;
1307
1346
  constructor(itemType: ItemType, type: string, id: number | string, name: string, supportsHeadShapes?: boolean);
1308
1347
  }
1309
1348
 
@@ -1313,7 +1352,7 @@ export declare class ItemSort {
1313
1352
  constructor(subType: number, itemType?: string);
1314
1353
  }
1315
1354
 
1316
- declare type ItemType = "Asset" | "Bundle" | "Outfit" | "Look" | "None";
1355
+ declare type ItemType = "Asset" | "Bundle" | "Outfit" | "Look" | "Avatar" | "None";
1317
1356
 
1318
1357
  declare class KDNode {
1319
1358
  point: Vec3;
@@ -1560,7 +1599,6 @@ export declare class ModelWrapper extends InstanceWrapper {
1560
1599
  static requiredProperties: string[];
1561
1600
  setup(): void;
1562
1601
  GetModelCFrame(): CFrame;
1563
- GetExtentsSize(): Vector3;
1564
1602
  }
1565
1603
 
1566
1604
  /**
@@ -1765,6 +1803,7 @@ export declare class Outfit {
1765
1803
  removeAssetType(type: string | number): void;
1766
1804
  addAsset(id: number, type: string | number, name: string, supportsHeadShapes?: boolean): void;
1767
1805
  fixOrders(): void;
1806
+ getAssetsAtOrder(order: number): Asset[];
1768
1807
  isOrderUsed(order: number, self?: Asset): boolean;
1769
1808
  getNextOrder(order: number): number;
1770
1809
  addAssetId(assetId: number, auth: Authentication): Promise<boolean>;
@@ -1883,12 +1922,6 @@ declare class PartKeyframeGroup extends BaseKeyframeGroup {
1883
1922
  getLowerKeyframe(time: number): PartKeyframe | null;
1884
1923
  }
1885
1924
 
1886
- declare type Patch = {
1887
- center: Vec3;
1888
- neighborIndices: number[];
1889
- weights?: Float32Array;
1890
- };
1891
-
1892
1925
  declare class PRNT {
1893
1926
  instanceCount: number;
1894
1927
  childReferents: number[];
@@ -1982,14 +2015,16 @@ export declare class RBFDeformer {
1982
2015
 
1983
2016
  export declare class RBFDeformerPatch {
1984
2017
  mesh: FileMesh;
1985
- refVerts: FileMeshVertex[];
1986
- distVerts: FileMeshVertex[];
1987
- importantIndices: number[];
2018
+ refVerts: Float32Array;
2019
+ distVerts: Float32Array;
2020
+ importantIndices: Uint16Array;
1988
2021
  controlKD: KDNode | null;
1989
2022
  patchKD: KDNode | null;
1990
- patches: Patch[];
1991
- patchCenters: Vec3[];
1992
- nearestPatch: Uint16Array;
2023
+ meshVerts: Float32Array;
2024
+ meshBones: Float32Array;
2025
+ nearestPatch?: Uint16Array;
2026
+ neighborIndices?: Uint16Array[];
2027
+ weights?: Float32Array[];
1993
2028
  K: number;
1994
2029
  patchCount: number;
1995
2030
  epsilon: number;
@@ -2048,6 +2083,9 @@ export declare class RBXRenderer {
2048
2083
  static resolution: [number, number];
2049
2084
  static backgroundColorHex: number;
2050
2085
  static backgroundTransparent: boolean;
2086
+ static _wellLitDirectionalLightIntensity: number;
2087
+ static set wellLitDirectionalLightIntensity(v: number);
2088
+ static get wellLitDirectionalLightIntensity(): number;
2051
2089
  static createLoadingIcon: boolean;
2052
2090
  static canvasContainer: HTMLDivElement;
2053
2091
  static loadingIcon?: HTMLSpanElement;
@@ -2377,6 +2415,11 @@ declare class SKINNING {
2377
2415
  getSubsetIndex(vertIndex: number): number;
2378
2416
  }
2379
2417
 
2418
+ export declare function snapToNumber(value: number, numbers: number[]): number;
2419
+
2420
+ export declare class SortDivision {
2421
+ }
2422
+
2380
2423
  export declare class SortInfo {
2381
2424
  sortOption: string;
2382
2425
  itemCategories: ItemSort[];
@@ -2500,6 +2543,22 @@ export declare interface UserLooks_Result {
2500
2543
  previousCursor: string | null;
2501
2544
  }
2502
2545
 
2546
+ export declare interface UserOmniSearch_Result {
2547
+ "searchResults": {
2548
+ "contentGroupType": "User";
2549
+ "contents": {
2550
+ "username": string;
2551
+ "displayName": string;
2552
+ "previousUsernames": null | string[];
2553
+ "hasVerifiedBadge": boolean;
2554
+ "contentType": "User";
2555
+ "contentId": number;
2556
+ "defaultLayoutData": null;
2557
+ }[];
2558
+ }[];
2559
+ "nextPageToken": string;
2560
+ }
2561
+
2503
2562
  declare type ValidationIssue = {
2504
2563
  type: ValidationIssueType;
2505
2564
  text: string;