roavatar-renderer 1.2.4 → 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 +37 -19
- package/dist/index.js +572 -348
- 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;
|
|
@@ -942,6 +946,7 @@ export declare const FLAGS: {
|
|
|
942
946
|
ENABLE_LC_WEIGHT_CACHE: boolean;
|
|
943
947
|
INFLATE_LAYERED_CLOTHING: number;
|
|
944
948
|
LAYERED_CLOTHING_ALGORITHM: "linear" | "linearnormal" | "linearnormal2" | "rbf";
|
|
949
|
+
SHOW_CAGE: boolean;
|
|
945
950
|
RBF_PATCH_COUNT: number;
|
|
946
951
|
RBF_PATCH_DETAIL_SAMPLES: number;
|
|
947
952
|
RBF_PATCH_SHAPE_SAMPLES: number;
|
|
@@ -951,6 +956,7 @@ export declare const FLAGS: {
|
|
|
951
956
|
GEAR_ENABLED: boolean;
|
|
952
957
|
AUDIO_ENABLED: boolean;
|
|
953
958
|
LEGACY_WELD_BEHAVIOR: boolean;
|
|
959
|
+
USE_RENDERTARGET: boolean;
|
|
954
960
|
SHOW_SKELETON_HELPER: boolean;
|
|
955
961
|
UPDATE_SKELETON: boolean;
|
|
956
962
|
ANIMATE_SKELETON: boolean;
|
|
@@ -1078,7 +1084,7 @@ declare class HSRAVIS {
|
|
|
1078
1084
|
clone(): HSRAVIS;
|
|
1079
1085
|
}
|
|
1080
1086
|
|
|
1081
|
-
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";
|
|
1082
1088
|
|
|
1083
1089
|
export declare class HumanoidDescriptionWrapper extends InstanceWrapper {
|
|
1084
1090
|
static className: string;
|
|
@@ -1099,7 +1105,9 @@ export declare class HumanoidDescriptionWrapper extends InstanceWrapper {
|
|
|
1099
1105
|
getBodyPartDescription(bodyPart: number): Instance | undefined;
|
|
1100
1106
|
getBodyPartColor(bodyPart: number): Color3;
|
|
1101
1107
|
setBodyPartId(bodyPart: number, id: bigint): void;
|
|
1108
|
+
setBodyPartHeadShape(bodyPart: number, headShape: string): void;
|
|
1102
1109
|
getBodyPartId(bodyPart: number): bigint;
|
|
1110
|
+
getBodyPartHeadShape(bodyPart: number): string;
|
|
1103
1111
|
createRigData(): RigData | undefined;
|
|
1104
1112
|
fromOutfit(outfit: Outfit): Promise<Instance | Response>;
|
|
1105
1113
|
_applyScale(humanoid: Instance): void;
|
|
@@ -1271,6 +1279,7 @@ export declare interface ItemDetail_Result {
|
|
|
1271
1279
|
name: string;
|
|
1272
1280
|
offsaleDeadline: null;
|
|
1273
1281
|
saleLocationType: SaleLocationType;
|
|
1282
|
+
supportsHeadShapes?: boolean;
|
|
1274
1283
|
taxonomy: {
|
|
1275
1284
|
taxonomyId: string;
|
|
1276
1285
|
taxonomyName: string;
|
|
@@ -1290,7 +1299,9 @@ export declare class ItemInfo {
|
|
|
1290
1299
|
price?: number;
|
|
1291
1300
|
limitedType?: "Limited" | "LimitedUnique";
|
|
1292
1301
|
offsale?: boolean;
|
|
1293
|
-
|
|
1302
|
+
supportsHeadShapes?: boolean;
|
|
1303
|
+
headShape?: string;
|
|
1304
|
+
constructor(itemType: ItemType, type: string, id: number | string, name: string, supportsHeadShapes?: boolean);
|
|
1294
1305
|
}
|
|
1295
1306
|
|
|
1296
1307
|
export declare class ItemSort {
|
|
@@ -1339,7 +1350,7 @@ export declare class LocalOutfit {
|
|
|
1339
1350
|
toJson(): LocalOutfitJson;
|
|
1340
1351
|
fromJson(data: LocalOutfitJson): this;
|
|
1341
1352
|
update(outfit: Outfit): void;
|
|
1342
|
-
toOutfit(): Promise<Outfit>;
|
|
1353
|
+
toOutfit(auth: Authentication): Promise<Outfit>;
|
|
1343
1354
|
}
|
|
1344
1355
|
|
|
1345
1356
|
export declare interface LocalOutfitJson {
|
|
@@ -1748,15 +1759,15 @@ export declare class Outfit {
|
|
|
1748
1759
|
containsAssetType(assetType: string): boolean;
|
|
1749
1760
|
removeAsset(assetId: number): void;
|
|
1750
1761
|
removeAssetType(type: string | number): void;
|
|
1751
|
-
addAsset(id: number, type: string | number, name: string): void;
|
|
1762
|
+
addAsset(id: number, type: string | number, name: string, supportsHeadShapes?: boolean): void;
|
|
1752
1763
|
fixOrders(): void;
|
|
1753
1764
|
isOrderUsed(order: number, self?: Asset): boolean;
|
|
1754
1765
|
getNextOrder(order: number): number;
|
|
1755
|
-
addAssetId(assetId: number): Promise<boolean>;
|
|
1766
|
+
addAssetId(assetId: number, auth: Authentication): Promise<boolean>;
|
|
1756
1767
|
addBundleId(bundleId: number): Promise<boolean>;
|
|
1757
1768
|
getAssetId(assetId: number): Asset | undefined;
|
|
1758
|
-
fromLook(look: Look_Result["look"]): Promise<boolean>;
|
|
1759
|
-
fromBuffer(buffer: ArrayBuffer): Promise<
|
|
1769
|
+
fromLook(look: Look_Result["look"], auth: Authentication): Promise<boolean>;
|
|
1770
|
+
fromBuffer(buffer: ArrayBuffer, auth: Authentication): Promise<Response | Outfit>;
|
|
1760
1771
|
toBuffer(): ArrayBuffer;
|
|
1761
1772
|
}
|
|
1762
1773
|
|
|
@@ -2025,7 +2036,7 @@ export declare class RBXRenderer {
|
|
|
2025
2036
|
static scene: THREE.Scene;
|
|
2026
2037
|
static camera: THREE.PerspectiveCamera;
|
|
2027
2038
|
static controls: OrbitControls | undefined;
|
|
2028
|
-
static renderer
|
|
2039
|
+
static renderer?: THREE.WebGLRenderer;
|
|
2029
2040
|
static effectComposer: EffectComposer | undefined;
|
|
2030
2041
|
static shadowEnabled: boolean;
|
|
2031
2042
|
static shadowResolution: [number, number];
|
|
@@ -2041,9 +2052,16 @@ export declare class RBXRenderer {
|
|
|
2041
2052
|
static ambientLight?: THREE.AmbientLight;
|
|
2042
2053
|
static directionalLight?: THREE.DirectionalLight;
|
|
2043
2054
|
static directionalLight2?: THREE.DirectionalLight;
|
|
2055
|
+
static failedToCreate: boolean;
|
|
2056
|
+
static error?: unknown;
|
|
2044
2057
|
static boilerplateSetup(): Promise<void>;
|
|
2045
|
-
|
|
2046
|
-
|
|
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;
|
|
2047
2065
|
/**Sets up the THREE.js renderer */
|
|
2048
2066
|
static create(): void;
|
|
2049
2067
|
/**Sets up a basic scene with lighting
|
|
@@ -2075,14 +2093,14 @@ export declare class RBXRenderer {
|
|
|
2075
2093
|
* @deprecated Use getRendererElement instead which includes the loading icon
|
|
2076
2094
|
* @returns The element for the renderer canvas
|
|
2077
2095
|
*/
|
|
2078
|
-
static getRendererDom(): HTMLCanvasElement;
|
|
2096
|
+
static getRendererDom(): HTMLCanvasElement | undefined;
|
|
2079
2097
|
/**
|
|
2080
2098
|
* @returns An element containing the renderer canvas
|
|
2081
2099
|
*/
|
|
2082
2100
|
static getRendererElement(): HTMLDivElement;
|
|
2083
2101
|
static getRendererCamera(): THREE.PerspectiveCamera;
|
|
2084
2102
|
static getRendererControls(): OrbitControls | undefined;
|
|
2085
|
-
static getRenderer(): THREE.WebGLRenderer;
|
|
2103
|
+
static getRenderer(): THREE.WebGLRenderer | undefined;
|
|
2086
2104
|
static getScene(): THREE.Scene;
|
|
2087
2105
|
/**@deprecated
|
|
2088
2106
|
* This function is unstable and can throw errors, but might work
|