roavatar-renderer 1.2.5 → 1.2.7
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 +4 -1
- package/dist/index.d.ts +38 -19
- package/dist/index.js +512 -276
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,7 +23,10 @@ Basic example on how to load an avatar, that is also untested:
|
|
|
23
23
|
//actually creating renderer
|
|
24
24
|
const includeScene = true
|
|
25
25
|
const includeControls = true
|
|
26
|
-
await RBXRenderer.fullSetup(includeScene, includeControls)
|
|
26
|
+
const success = await RBXRenderer.fullSetup(includeScene, includeControls)
|
|
27
|
+
if (!success) {
|
|
28
|
+
//roavatar-renderer automatically displays an error, but your own behavior can be included here (like a fallback)
|
|
29
|
+
}
|
|
27
30
|
//renderer customization
|
|
28
31
|
RBXRenderer.setBackgroundColor( 0xffffff )
|
|
29
32
|
RBXRenderer.setRendererSize(1000,500)
|
package/dist/index.d.ts
CHANGED
|
@@ -200,7 +200,7 @@ export declare const API: {
|
|
|
200
200
|
idFromStr: (str: string) => number;
|
|
201
201
|
parseAssetString: (str: string) => string;
|
|
202
202
|
getCDNURLFromAssetDelivery: (url: string, headers?: any) => Promise<string | Response>;
|
|
203
|
-
assetURLToCDNURL: (url: string | number | bigint, headers?: any) => Promise<string | Response>;
|
|
203
|
+
assetURLToCDNURL: (url: string | number | bigint, headers?: any, extraStr?: string) => Promise<string | Response>;
|
|
204
204
|
};
|
|
205
205
|
Events: {
|
|
206
206
|
OnLoadingAssets: Event_2;
|
|
@@ -223,6 +223,7 @@ export declare const API: {
|
|
|
223
223
|
WearOutfit: (auth: Authentication, outfit: Outfit, onlyItems: boolean) => Promise<[boolean, boolean]>;
|
|
224
224
|
SaveOutfitNoRetry: (auth: Authentication, outfit: Outfit) => Promise<Response>;
|
|
225
225
|
GetAvatarDetails: (userId: number) => Promise<Response | Outfit>;
|
|
226
|
+
GetHeadShapes: (pageToken: string | null | undefined) => Promise<AvatarInventory_Result | Response>;
|
|
226
227
|
GetAvatarInventory: (sortOption: string, pageToken: string | null | undefined, itemInfos?: ItemSort[]) => Promise<AvatarInventory_Result | Response>;
|
|
227
228
|
GetOutfitDetails: (outfitId: number | string, userId: number) => Promise<Response | Outfit>;
|
|
228
229
|
SaveOutfit: (auth: Authentication, outfit: Outfit) => Promise<Response>;
|
|
@@ -238,8 +239,8 @@ export declare const API: {
|
|
|
238
239
|
SetThumbnailCustomization: (auth: Authentication, body: ThumbnailsCustomization_Payload) => Promise<Response>;
|
|
239
240
|
};
|
|
240
241
|
Asset: {
|
|
241
|
-
GetAssetBuffer: (url: string, headers?: HeadersInit) => Promise<Response | ArrayBuffer>;
|
|
242
|
-
GetRBX: (url: string, headers?: HeadersInit) => Promise<Response | RBX>;
|
|
242
|
+
GetAssetBuffer: (url: string, headers?: HeadersInit, extraStr?: string) => Promise<Response | ArrayBuffer>;
|
|
243
|
+
GetRBX: (url: string, headers?: HeadersInit, contentRepresentationPriorityList?: any) => Promise<Response | RBX>;
|
|
243
244
|
GetMesh: (url: string, headers?: HeadersInit, readOnly?: boolean) => Promise<FileMesh | Response>;
|
|
244
245
|
IsLayered: (id: number) => Promise<boolean | Response>;
|
|
245
246
|
};
|
|
@@ -263,8 +264,8 @@ export declare const API: {
|
|
|
263
264
|
GetUserInfo: () => Promise<UserInfo | undefined>;
|
|
264
265
|
};
|
|
265
266
|
Thumbnails: {
|
|
266
|
-
GetThumbnail: (auth: Authentication, type: string, id: number | string, size?: string) => Promise<string | undefined>;
|
|
267
|
-
UncacheThumbnail: (type: string, id: number | string, size?: string) => void;
|
|
267
|
+
GetThumbnail: (auth: Authentication, type: string, id: number | string, size?: string, headShape?: string) => Promise<string | undefined>;
|
|
268
|
+
UncacheThumbnail: (type: string, id: number | string, size?: string, headShape?: string) => void;
|
|
268
269
|
RenderOutfit: (auth: Authentication, outfit: Outfit, attempt?: number) => Promise<string | undefined>;
|
|
269
270
|
};
|
|
270
271
|
LocalOutfit: {
|
|
@@ -315,7 +316,7 @@ export declare class AssetMeta {
|
|
|
315
316
|
position?: VecXYZ;
|
|
316
317
|
rotation?: VecXYZ;
|
|
317
318
|
scale?: VecXYZ;
|
|
318
|
-
headShape?:
|
|
319
|
+
headShape?: string;
|
|
319
320
|
staticFacialAnimation?: boolean;
|
|
320
321
|
constructor();
|
|
321
322
|
clone(): AssetMeta;
|
|
@@ -330,7 +331,7 @@ export declare type AssetMetaJson = {
|
|
|
330
331
|
scale?: VecXYZ | Vecxyz | null;
|
|
331
332
|
order?: number | null;
|
|
332
333
|
puffiness?: number | null;
|
|
333
|
-
headShape?: "Invalid" | number;
|
|
334
|
+
headShape?: "Invalid" | string | number;
|
|
334
335
|
staticFacialAnimation?: boolean;
|
|
335
336
|
};
|
|
336
337
|
|
|
@@ -414,6 +415,7 @@ export declare interface AvatarInventory_Result {
|
|
|
414
415
|
};
|
|
415
416
|
availabilityStatus: string;
|
|
416
417
|
acquisitionTime: string;
|
|
418
|
+
headShape?: string;
|
|
417
419
|
outfitDetail?: {
|
|
418
420
|
assets: {
|
|
419
421
|
id: number;
|
|
@@ -578,6 +580,7 @@ export declare interface BundleDetails_Result {
|
|
|
578
580
|
name: string;
|
|
579
581
|
owned: boolean;
|
|
580
582
|
type: "Asset" | "UserOutfit";
|
|
583
|
+
supportsHeadShapes?: boolean;
|
|
581
584
|
}[];
|
|
582
585
|
collectibleItemId: string;
|
|
583
586
|
creatorHasVerifiedBadge: boolean;
|
|
@@ -640,6 +643,8 @@ export declare class CFrame {
|
|
|
640
643
|
|
|
641
644
|
export declare function clamp(v0: Vec3, lower: Vec3, higher: Vec3): Vec3;
|
|
642
645
|
|
|
646
|
+
export declare function cleanString(inputString: string): string;
|
|
647
|
+
|
|
643
648
|
export declare function clonePrimitiveArray<T>(arr: T[]): T[];
|
|
644
649
|
|
|
645
650
|
export declare function cloneSearch_Payload(data: Search_Payload): Search_Payload;
|
|
@@ -1080,7 +1085,7 @@ declare class HSRAVIS {
|
|
|
1080
1085
|
clone(): HSRAVIS;
|
|
1081
1086
|
}
|
|
1082
1087
|
|
|
1083
|
-
declare type HumanoidDescriptionDiff = "scale" | "bodyColor" | "animation" | "bodyPart" | "clothing" | "face" | "accessory" | "makeup" | "gear";
|
|
1088
|
+
declare type HumanoidDescriptionDiff = "scale" | "bodyColor" | "animation" | "bodyPart" | "clothing" | "face" | "accessory" | "makeup" | "gear" | "staticFacialAnimation";
|
|
1084
1089
|
|
|
1085
1090
|
export declare class HumanoidDescriptionWrapper extends InstanceWrapper {
|
|
1086
1091
|
static className: string;
|
|
@@ -1101,7 +1106,9 @@ export declare class HumanoidDescriptionWrapper extends InstanceWrapper {
|
|
|
1101
1106
|
getBodyPartDescription(bodyPart: number): Instance | undefined;
|
|
1102
1107
|
getBodyPartColor(bodyPart: number): Color3;
|
|
1103
1108
|
setBodyPartId(bodyPart: number, id: bigint): void;
|
|
1109
|
+
setBodyPartHeadShape(bodyPart: number, headShape: string): void;
|
|
1104
1110
|
getBodyPartId(bodyPart: number): bigint;
|
|
1111
|
+
getBodyPartHeadShape(bodyPart: number): string;
|
|
1105
1112
|
createRigData(): RigData | undefined;
|
|
1106
1113
|
fromOutfit(outfit: Outfit): Promise<Instance | Response>;
|
|
1107
1114
|
_applyScale(humanoid: Instance): void;
|
|
@@ -1273,6 +1280,7 @@ export declare interface ItemDetail_Result {
|
|
|
1273
1280
|
name: string;
|
|
1274
1281
|
offsaleDeadline: null;
|
|
1275
1282
|
saleLocationType: SaleLocationType;
|
|
1283
|
+
supportsHeadShapes?: boolean;
|
|
1276
1284
|
taxonomy: {
|
|
1277
1285
|
taxonomyId: string;
|
|
1278
1286
|
taxonomyName: string;
|
|
@@ -1292,7 +1300,9 @@ export declare class ItemInfo {
|
|
|
1292
1300
|
price?: number;
|
|
1293
1301
|
limitedType?: "Limited" | "LimitedUnique";
|
|
1294
1302
|
offsale?: boolean;
|
|
1295
|
-
|
|
1303
|
+
supportsHeadShapes?: boolean;
|
|
1304
|
+
headShape?: string;
|
|
1305
|
+
constructor(itemType: ItemType, type: string, id: number | string, name: string, supportsHeadShapes?: boolean);
|
|
1296
1306
|
}
|
|
1297
1307
|
|
|
1298
1308
|
export declare class ItemSort {
|
|
@@ -1341,7 +1351,7 @@ export declare class LocalOutfit {
|
|
|
1341
1351
|
toJson(): LocalOutfitJson;
|
|
1342
1352
|
fromJson(data: LocalOutfitJson): this;
|
|
1343
1353
|
update(outfit: Outfit): void;
|
|
1344
|
-
toOutfit(): Promise<Outfit>;
|
|
1354
|
+
toOutfit(auth: Authentication): Promise<Outfit>;
|
|
1345
1355
|
}
|
|
1346
1356
|
|
|
1347
1357
|
export declare interface LocalOutfitJson {
|
|
@@ -1399,6 +1409,7 @@ export declare interface Look_Result {
|
|
|
1399
1409
|
id: number;
|
|
1400
1410
|
isIncluded: boolean;
|
|
1401
1411
|
supportsHeadshapes?: boolean;
|
|
1412
|
+
meta?: AssetMetaJson;
|
|
1402
1413
|
}[];
|
|
1403
1414
|
bundleType: number | null;
|
|
1404
1415
|
collectibleItemId: string;
|
|
@@ -1750,15 +1761,16 @@ export declare class Outfit {
|
|
|
1750
1761
|
containsAssetType(assetType: string): boolean;
|
|
1751
1762
|
removeAsset(assetId: number): void;
|
|
1752
1763
|
removeAssetType(type: string | number): void;
|
|
1753
|
-
addAsset(id: number, type: string | number, name: string): void;
|
|
1764
|
+
addAsset(id: number, type: string | number, name: string, supportsHeadShapes?: boolean): void;
|
|
1754
1765
|
fixOrders(): void;
|
|
1755
1766
|
isOrderUsed(order: number, self?: Asset): boolean;
|
|
1756
1767
|
getNextOrder(order: number): number;
|
|
1757
|
-
addAssetId(assetId: number): Promise<boolean>;
|
|
1768
|
+
addAssetId(assetId: number, auth: Authentication): Promise<boolean>;
|
|
1769
|
+
addAssetIdEconomy(assetId: number): Promise<boolean>;
|
|
1758
1770
|
addBundleId(bundleId: number): Promise<boolean>;
|
|
1759
1771
|
getAssetId(assetId: number): Asset | undefined;
|
|
1760
|
-
fromLook(look: Look_Result["look"]): Promise<boolean>;
|
|
1761
|
-
fromBuffer(buffer: ArrayBuffer): Promise<
|
|
1772
|
+
fromLook(look: Look_Result["look"], auth: Authentication): Promise<boolean>;
|
|
1773
|
+
fromBuffer(buffer: ArrayBuffer, auth: Authentication): Promise<Response | Outfit>;
|
|
1762
1774
|
toBuffer(): ArrayBuffer;
|
|
1763
1775
|
}
|
|
1764
1776
|
|
|
@@ -2027,7 +2039,7 @@ export declare class RBXRenderer {
|
|
|
2027
2039
|
static scene: THREE.Scene;
|
|
2028
2040
|
static camera: THREE.PerspectiveCamera;
|
|
2029
2041
|
static controls: OrbitControls | undefined;
|
|
2030
|
-
static renderer
|
|
2042
|
+
static renderer?: THREE.WebGLRenderer;
|
|
2031
2043
|
static effectComposer: EffectComposer | undefined;
|
|
2032
2044
|
static shadowEnabled: boolean;
|
|
2033
2045
|
static shadowResolution: [number, number];
|
|
@@ -2043,9 +2055,16 @@ export declare class RBXRenderer {
|
|
|
2043
2055
|
static ambientLight?: THREE.AmbientLight;
|
|
2044
2056
|
static directionalLight?: THREE.DirectionalLight;
|
|
2045
2057
|
static directionalLight2?: THREE.DirectionalLight;
|
|
2058
|
+
static failedToCreate: boolean;
|
|
2059
|
+
static error?: unknown;
|
|
2046
2060
|
static boilerplateSetup(): Promise<void>;
|
|
2047
|
-
|
|
2048
|
-
|
|
2061
|
+
static showErrorHTML(): Promise<void>;
|
|
2062
|
+
/**Fully sets up renderer with scene, camera and frame rendering
|
|
2063
|
+
* @returns success
|
|
2064
|
+
*/
|
|
2065
|
+
static fullSetup(includeScene?: boolean, includeControls?: boolean): Promise<boolean>;
|
|
2066
|
+
/**Creates canvasContainer */
|
|
2067
|
+
static createContainer(): void;
|
|
2049
2068
|
/**Sets up the THREE.js renderer */
|
|
2050
2069
|
static create(): void;
|
|
2051
2070
|
/**Sets up a basic scene with lighting
|
|
@@ -2077,14 +2096,14 @@ export declare class RBXRenderer {
|
|
|
2077
2096
|
* @deprecated Use getRendererElement instead which includes the loading icon
|
|
2078
2097
|
* @returns The element for the renderer canvas
|
|
2079
2098
|
*/
|
|
2080
|
-
static getRendererDom(): HTMLCanvasElement;
|
|
2099
|
+
static getRendererDom(): HTMLCanvasElement | undefined;
|
|
2081
2100
|
/**
|
|
2082
2101
|
* @returns An element containing the renderer canvas
|
|
2083
2102
|
*/
|
|
2084
2103
|
static getRendererElement(): HTMLDivElement;
|
|
2085
2104
|
static getRendererCamera(): THREE.PerspectiveCamera;
|
|
2086
2105
|
static getRendererControls(): OrbitControls | undefined;
|
|
2087
|
-
static getRenderer(): THREE.WebGLRenderer;
|
|
2106
|
+
static getRenderer(): THREE.WebGLRenderer | undefined;
|
|
2088
2107
|
static getScene(): THREE.Scene;
|
|
2089
2108
|
/**@deprecated
|
|
2090
2109
|
* This function is unstable and can throw errors, but might work
|