roavatar-renderer 1.4.5 → 1.5.1

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 +42 -10
  2. package/dist/index.js +3614 -2856
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -234,7 +234,14 @@ export declare class AnimatorWrapper extends InstanceWrapper {
234
234
  */
235
235
  getCurrentAnimationTrack(): AnimationTrack | undefined;
236
236
  /**
237
- * Loads a new animation
237
+ * Loads an animation (not to be confused with an avatar animation like those found on the catalog)
238
+ * @param id
239
+ * @param forceLoop Forces animation track to loop
240
+ * @returns AnimationTrack on success
241
+ */
242
+ loadAnimation(id: bigint, forceLoop?: boolean): Promise<AnimationTrack | Response | undefined>;
243
+ /**
244
+ * Loads a new avatar animation (catalog run animation or emote, not to be confused with a creator store animation)
238
245
  * @param id
239
246
  * @param isEmote
240
247
  * @param forceLoop Forces animation track to loop
@@ -243,7 +250,7 @@ export declare class AnimatorWrapper extends InstanceWrapper {
243
250
  loadAvatarAnimation(id: bigint, isEmote?: boolean, forceLoop?: boolean): Promise<Response | undefined>;
244
251
  /**
245
252
  * Switches to new animation
246
- * @param name Animation name, such as "idle", "walk" or "emote.1234"
253
+ * @param name Animation name, such as "idle", "walk", "emote.1234" or "id.1234"
247
254
  * @param type
248
255
  * @returns If animation sucessfully played
249
256
  */
@@ -276,13 +283,14 @@ export declare const animNamesR6: AnimationSet;
276
283
  */
277
284
  export declare const API: {
278
285
  Misc: {
279
- startCurrentlyLoadingAssets: () => void;
280
- stopCurrentlyLoadingAssets: () => void;
286
+ startCurrentlyLoadingAssets: (label: string) => void;
287
+ stopCurrentlyLoadingAssets: (label: string) => void;
281
288
  idFromStr: (str: string) => number;
282
289
  parseAssetString: (str: string) => string;
283
290
  getCDNURLFromAssetDelivery: (url: string, headers?: any) => Promise<string | Response>;
284
291
  assetURLToCDNURL: (url: string | number | bigint, headers?: any, extraStr?: string) => Promise<string | Response>;
285
292
  getCurrentlyLoading: () => boolean;
293
+ getCurrentlyLoadingLabels: () => string[];
286
294
  };
287
295
  Events: {
288
296
  OnLoadingAssets: Event_2;
@@ -571,6 +579,21 @@ export declare const AvatarType: {
571
579
  */
572
580
  export declare function averageVec3(vecs: Vec3[]): Vec3;
573
581
 
582
+ /**
583
+ *
584
+ * @param promise
585
+ * @param time
586
+ */
587
+ export declare function awaitTimeout<T>(promise: Promise<T>, time?: number): Promise<T | Response>;
588
+
589
+ /**
590
+ *
591
+ * @param promise
592
+ * @param time
593
+ * @throws
594
+ */
595
+ export declare function awaitTimeoutThrows<T>(promise: Promise<T>, time?: number): Promise<T>;
596
+
574
597
  /**
575
598
  * @category Mesh
576
599
  */
@@ -980,6 +1003,8 @@ export declare function createWeightsForMeshChunked(mesh: FileMesh, ref_mesh: Fi
980
1003
  */
981
1004
  export declare function cross(a: Vec3, b: Vec3): Vec3;
982
1005
 
1006
+ export declare type CurrentlyLoadingUpdateType = "start" | "finish";
1007
+
983
1008
  export declare const DataType: {
984
1009
  String: number;
985
1010
  Bool: number;
@@ -1084,8 +1109,6 @@ export declare function dot(v0: Vec3, v1: Vec3): number;
1084
1109
 
1085
1110
  export declare function download(filename: string, text: string): void;
1086
1111
 
1087
- export declare const EmitterGroupDescClassTypes: string[];
1088
-
1089
1112
  /**
1090
1113
  * @category DataModel
1091
1114
  */
@@ -1316,6 +1339,8 @@ export declare const FLAGS: {
1316
1339
  RENDERTARGET_TO_CANVASTEXTURE: boolean;
1317
1340
  /**Amount of time thumbnail generator will wait after no assets are being loaded to resolve, should be a little time at least so particles can render */
1318
1341
  THUMBNAIL_TIMEOUT: number;
1342
+ /**Always render attachments even when theyre set to not be visible */
1343
+ ALWAYS_SHOW_ATTACHMENTS: boolean;
1319
1344
  /**shows ThreeJS SkeletonHelper */
1320
1345
  SHOW_SKELETON_HELPER: boolean;
1321
1346
  /**skeleton is updated every frame */
@@ -1691,6 +1716,7 @@ export declare class HumanoidDescriptionWrapper extends InstanceWrapper {
1691
1716
  */
1692
1717
  private _applyAccessories;
1693
1718
  private _applyMakeup;
1719
+ private _loadDefaultAnimation;
1694
1720
  /**
1695
1721
  * @returns undefined on success
1696
1722
  */
@@ -2393,8 +2419,6 @@ export declare class NumberSequenceKeypoint {
2393
2419
  isSame(other: NumberSequenceKeypoint): boolean;
2394
2420
  }
2395
2421
 
2396
- export declare const ObjectDescClassTypes: string[];
2397
-
2398
2422
  declare class OctreeChild<T> {
2399
2423
  bounds: Bounds;
2400
2424
  data: T;
@@ -2580,6 +2604,8 @@ export declare class OutfitRenderer {
2580
2604
  * @param name The name of the animation, for example "idle", "run" or "emote.1234"
2581
2605
  */
2582
2606
  setMainAnimation(name: string): void;
2607
+ /**Calls destroy on the rig and stops animating, the OutfitRenderer should not be interacted with after this */
2608
+ destroy(): void;
2583
2609
  }
2584
2610
 
2585
2611
  declare class PartCurve {
@@ -2724,6 +2750,7 @@ export declare class RBFDeformerPatch {
2724
2750
  patchCount: number;
2725
2751
  epsilon: number;
2726
2752
  affectBones: boolean;
2753
+ hasSolved: boolean;
2727
2754
  id: number;
2728
2755
  /**
2729
2756
  * Creates the deformer and prepares for deformation
@@ -2998,8 +3025,9 @@ export declare const RegularBodyColors: string[];
2998
3025
  * Abstract class used to describe all rendered instances
2999
3026
  */
3000
3027
  declare class RenderDesc extends DisposableDesc {
3028
+ static classTypes: string[];
3001
3029
  renderScene: RBXRendererScene;
3002
- results?: THREE.Mesh[];
3030
+ results?: THREE.Object3D[];
3003
3031
  instance?: Instance;
3004
3032
  constructor(renderScene: RBXRendererScene);
3005
3033
  isSame(_other: RenderDesc): boolean;
@@ -3009,8 +3037,11 @@ declare class RenderDesc extends DisposableDesc {
3009
3037
  virtualTransferFrom(_other: RenderDesc): void;
3010
3038
  virtualFromRenderDesc(_other: RenderDesc): void;
3011
3039
  fromInstance(_child: Instance): void;
3012
- compileResults(_renderer: THREE.WebGLRenderer, _scene: THREE.Scene): Promise<THREE.Mesh[] | Response | undefined>;
3040
+ compileResults(_renderer: THREE.WebGLRenderer, _scene: THREE.Scene): Promise<THREE.Object3D[] | Response | undefined>;
3013
3041
  updateResults(): void;
3042
+ static shouldRenderInstance(_instance: Instance): boolean;
3043
+ static register(): void;
3044
+ static(): typeof RenderDesc;
3014
3045
  }
3015
3046
 
3016
3047
  export declare function replaceBodyPart(rig: Instance, child: Instance): void;
@@ -3276,6 +3307,7 @@ export declare class SoundWrapper extends InstanceWrapper {
3276
3307
  get data(): SoundWrapperData;
3277
3308
  created(): void;
3278
3309
  _updateVolume(): void;
3310
+ setPlaying(value: boolean): void;
3279
3311
  playSource(): void;
3280
3312
  Play(): void;
3281
3313
  Stop(): void;