roavatar-renderer 1.2.5 → 1.2.6
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 +35 -19
- package/dist/index.js +466 -269
- 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
|
|
|
@@ -578,6 +579,7 @@ export declare interface BundleDetails_Result {
|
|
|
578
579
|
name: string;
|
|
579
580
|
owned: boolean;
|
|
580
581
|
type: "Asset" | "UserOutfit";
|
|
582
|
+
supportsHeadShapes?: boolean;
|
|
581
583
|
}[];
|
|
582
584
|
collectibleItemId: string;
|
|
583
585
|
creatorHasVerifiedBadge: boolean;
|
|
@@ -640,6 +642,8 @@ export declare class CFrame {
|
|
|
640
642
|
|
|
641
643
|
export declare function clamp(v0: Vec3, lower: Vec3, higher: Vec3): Vec3;
|
|
642
644
|
|
|
645
|
+
export declare function cleanString(inputString: string): string;
|
|
646
|
+
|
|
643
647
|
export declare function clonePrimitiveArray<T>(arr: T[]): T[];
|
|
644
648
|
|
|
645
649
|
export declare function cloneSearch_Payload(data: Search_Payload): Search_Payload;
|
|
@@ -1080,7 +1084,7 @@ declare class HSRAVIS {
|
|
|
1080
1084
|
clone(): HSRAVIS;
|
|
1081
1085
|
}
|
|
1082
1086
|
|
|
1083
|
-
declare type HumanoidDescriptionDiff = "scale" | "bodyColor" | "animation" | "bodyPart" | "clothing" | "face" | "accessory" | "makeup" | "gear";
|
|
1087
|
+
declare type HumanoidDescriptionDiff = "scale" | "bodyColor" | "animation" | "bodyPart" | "clothing" | "face" | "accessory" | "makeup" | "gear" | "staticFacialAnimation";
|
|
1084
1088
|
|
|
1085
1089
|
export declare class HumanoidDescriptionWrapper extends InstanceWrapper {
|
|
1086
1090
|
static className: string;
|
|
@@ -1101,7 +1105,9 @@ export declare class HumanoidDescriptionWrapper extends InstanceWrapper {
|
|
|
1101
1105
|
getBodyPartDescription(bodyPart: number): Instance | undefined;
|
|
1102
1106
|
getBodyPartColor(bodyPart: number): Color3;
|
|
1103
1107
|
setBodyPartId(bodyPart: number, id: bigint): void;
|
|
1108
|
+
setBodyPartHeadShape(bodyPart: number, headShape: string): void;
|
|
1104
1109
|
getBodyPartId(bodyPart: number): bigint;
|
|
1110
|
+
getBodyPartHeadShape(bodyPart: number): string;
|
|
1105
1111
|
createRigData(): RigData | undefined;
|
|
1106
1112
|
fromOutfit(outfit: Outfit): Promise<Instance | Response>;
|
|
1107
1113
|
_applyScale(humanoid: Instance): void;
|
|
@@ -1273,6 +1279,7 @@ export declare interface ItemDetail_Result {
|
|
|
1273
1279
|
name: string;
|
|
1274
1280
|
offsaleDeadline: null;
|
|
1275
1281
|
saleLocationType: SaleLocationType;
|
|
1282
|
+
supportsHeadShapes?: boolean;
|
|
1276
1283
|
taxonomy: {
|
|
1277
1284
|
taxonomyId: string;
|
|
1278
1285
|
taxonomyName: string;
|
|
@@ -1292,7 +1299,9 @@ export declare class ItemInfo {
|
|
|
1292
1299
|
price?: number;
|
|
1293
1300
|
limitedType?: "Limited" | "LimitedUnique";
|
|
1294
1301
|
offsale?: boolean;
|
|
1295
|
-
|
|
1302
|
+
supportsHeadShapes?: boolean;
|
|
1303
|
+
headShape?: string;
|
|
1304
|
+
constructor(itemType: ItemType, type: string, id: number | string, name: string, supportsHeadShapes?: boolean);
|
|
1296
1305
|
}
|
|
1297
1306
|
|
|
1298
1307
|
export declare class ItemSort {
|
|
@@ -1341,7 +1350,7 @@ export declare class LocalOutfit {
|
|
|
1341
1350
|
toJson(): LocalOutfitJson;
|
|
1342
1351
|
fromJson(data: LocalOutfitJson): this;
|
|
1343
1352
|
update(outfit: Outfit): void;
|
|
1344
|
-
toOutfit(): Promise<Outfit>;
|
|
1353
|
+
toOutfit(auth: Authentication): Promise<Outfit>;
|
|
1345
1354
|
}
|
|
1346
1355
|
|
|
1347
1356
|
export declare interface LocalOutfitJson {
|
|
@@ -1750,15 +1759,15 @@ export declare class Outfit {
|
|
|
1750
1759
|
containsAssetType(assetType: string): boolean;
|
|
1751
1760
|
removeAsset(assetId: number): void;
|
|
1752
1761
|
removeAssetType(type: string | number): void;
|
|
1753
|
-
addAsset(id: number, type: string | number, name: string): void;
|
|
1762
|
+
addAsset(id: number, type: string | number, name: string, supportsHeadShapes?: boolean): void;
|
|
1754
1763
|
fixOrders(): void;
|
|
1755
1764
|
isOrderUsed(order: number, self?: Asset): boolean;
|
|
1756
1765
|
getNextOrder(order: number): number;
|
|
1757
|
-
addAssetId(assetId: number): Promise<boolean>;
|
|
1766
|
+
addAssetId(assetId: number, auth: Authentication): Promise<boolean>;
|
|
1758
1767
|
addBundleId(bundleId: number): Promise<boolean>;
|
|
1759
1768
|
getAssetId(assetId: number): Asset | undefined;
|
|
1760
|
-
fromLook(look: Look_Result["look"]): Promise<boolean>;
|
|
1761
|
-
fromBuffer(buffer: ArrayBuffer): Promise<
|
|
1769
|
+
fromLook(look: Look_Result["look"], auth: Authentication): Promise<boolean>;
|
|
1770
|
+
fromBuffer(buffer: ArrayBuffer, auth: Authentication): Promise<Response | Outfit>;
|
|
1762
1771
|
toBuffer(): ArrayBuffer;
|
|
1763
1772
|
}
|
|
1764
1773
|
|
|
@@ -2027,7 +2036,7 @@ export declare class RBXRenderer {
|
|
|
2027
2036
|
static scene: THREE.Scene;
|
|
2028
2037
|
static camera: THREE.PerspectiveCamera;
|
|
2029
2038
|
static controls: OrbitControls | undefined;
|
|
2030
|
-
static renderer
|
|
2039
|
+
static renderer?: THREE.WebGLRenderer;
|
|
2031
2040
|
static effectComposer: EffectComposer | undefined;
|
|
2032
2041
|
static shadowEnabled: boolean;
|
|
2033
2042
|
static shadowResolution: [number, number];
|
|
@@ -2043,9 +2052,16 @@ export declare class RBXRenderer {
|
|
|
2043
2052
|
static ambientLight?: THREE.AmbientLight;
|
|
2044
2053
|
static directionalLight?: THREE.DirectionalLight;
|
|
2045
2054
|
static directionalLight2?: THREE.DirectionalLight;
|
|
2055
|
+
static failedToCreate: boolean;
|
|
2056
|
+
static error?: unknown;
|
|
2046
2057
|
static boilerplateSetup(): Promise<void>;
|
|
2047
|
-
|
|
2048
|
-
|
|
2058
|
+
static showErrorHTML(): Promise<void>;
|
|
2059
|
+
/**Fully sets up renderer with scene, camera and frame rendering
|
|
2060
|
+
* @returns success
|
|
2061
|
+
*/
|
|
2062
|
+
static fullSetup(includeScene?: boolean, includeControls?: boolean): Promise<boolean>;
|
|
2063
|
+
/**Creates canvasContainer */
|
|
2064
|
+
static createContainer(): void;
|
|
2049
2065
|
/**Sets up the THREE.js renderer */
|
|
2050
2066
|
static create(): void;
|
|
2051
2067
|
/**Sets up a basic scene with lighting
|
|
@@ -2077,14 +2093,14 @@ export declare class RBXRenderer {
|
|
|
2077
2093
|
* @deprecated Use getRendererElement instead which includes the loading icon
|
|
2078
2094
|
* @returns The element for the renderer canvas
|
|
2079
2095
|
*/
|
|
2080
|
-
static getRendererDom(): HTMLCanvasElement;
|
|
2096
|
+
static getRendererDom(): HTMLCanvasElement | undefined;
|
|
2081
2097
|
/**
|
|
2082
2098
|
* @returns An element containing the renderer canvas
|
|
2083
2099
|
*/
|
|
2084
2100
|
static getRendererElement(): HTMLDivElement;
|
|
2085
2101
|
static getRendererCamera(): THREE.PerspectiveCamera;
|
|
2086
2102
|
static getRendererControls(): OrbitControls | undefined;
|
|
2087
|
-
static getRenderer(): THREE.WebGLRenderer;
|
|
2103
|
+
static getRenderer(): THREE.WebGLRenderer | undefined;
|
|
2088
2104
|
static getScene(): THREE.Scene;
|
|
2089
2105
|
/**@deprecated
|
|
2090
2106
|
* This function is unstable and can throw errors, but might work
|