roavatar-renderer 1.5.1 → 1.5.3

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/dist/index.d.ts CHANGED
@@ -1293,6 +1293,7 @@ export declare const FLAGS: {
1293
1293
  API_REQUEST_PREFIX: string;
1294
1294
  /**credentials request type when fetching from API_DOMAIN and credentials are usually include */
1295
1295
  INCLUDE_REQUEST_CREDENTIALS_OVERRIDE: RequestCredentials;
1296
+ API_REQUEST_RETRY: boolean;
1296
1297
  /**loads assets from assetdelivery instead of local files */
1297
1298
  ONLINE_ASSETS: boolean;
1298
1299
  /**path to rbxasset:// local files*/
@@ -1790,6 +1791,7 @@ export declare class Instance {
1790
1791
  set name(value: string);
1791
1792
  get name(): string;
1792
1793
  createWrapper(): InstanceWrapper | undefined;
1794
+ get w(): InstanceWrapper | undefined;
1793
1795
  addConnectionReference(connection: Connection): void;
1794
1796
  removeConnectionReference(connection: Connection): void;
1795
1797
  addReferencedBy(instance: Instance): void;
@@ -1843,6 +1845,8 @@ export declare class InstanceWrapper {
1843
1845
  constructor(instance: Instance);
1844
1846
  setup(): void;
1845
1847
  static(): typeof InstanceWrapper;
1848
+ static IsA(className: string): any;
1849
+ IsA(className: string): any;
1846
1850
  static register(): void;
1847
1851
  /**
1848
1852
  * @virtual
@@ -2568,6 +2572,14 @@ export declare class OutfitRenderer {
2568
2572
  animationFPS: number;
2569
2573
  deltaTimeMultiplier: number;
2570
2574
  renderScene: RBXRendererScene;
2575
+ /**Event is fired if a new outfit failed to load
2576
+ * @returns OutfitRendererErrorType
2577
+ */
2578
+ onError: Event_2;
2579
+ /**Event is fired if a new outfit successfully loaded
2580
+ * @returns void
2581
+ */
2582
+ onSuccess: Event_2;
2571
2583
  /**
2572
2584
  * Creates a new OutfitRenderer which makes it easy to render outfits
2573
2585
  * @param auth The authentication object, you should have one you use for everything
@@ -2608,6 +2620,8 @@ export declare class OutfitRenderer {
2608
2620
  destroy(): void;
2609
2621
  }
2610
2622
 
2623
+ export declare type OutfitRendererErrorType = "rig" | "humanoidDescription";
2624
+
2611
2625
  declare class PartCurve {
2612
2626
  motorParent: string;
2613
2627
  motorName: string;
@@ -2644,6 +2658,15 @@ declare class PartKeyframeGroup extends BaseKeyframeGroup {
2644
2658
  getLowerKeyframe(time: number): PartKeyframe | null;
2645
2659
  }
2646
2660
 
2661
+ /**@category DataModelEnum */
2662
+ export declare const PartType: {
2663
+ Ball: number;
2664
+ Block: number;
2665
+ Cylinder: number;
2666
+ Wedge: number;
2667
+ CornerWedge: number;
2668
+ };
2669
+
2647
2670
  declare class PRNT {
2648
2671
  instanceCount: number;
2649
2672
  childReferents: number[];
@@ -2784,7 +2807,7 @@ export declare class RBFDeformerPatch {
2784
2807
 
2785
2808
  declare function RBLXDelete(url: string, auth: Authentication, body: any, attempt?: number): Promise<Response>;
2786
2809
 
2787
- declare function RBLXGet(url: string, headers?: any, includeCredentials?: boolean): Promise<Response>;
2810
+ declare function RBLXGet(url: string, headers?: any, includeCredentials?: boolean, attempt?: number): Promise<Response>;
2788
2811
 
2789
2812
  declare function RBLXPatch(url: string, auth: Authentication, body: any, attempt?: number): Promise<Response>;
2790
2813
 
@@ -3395,6 +3418,8 @@ export declare function traverseRigCFrame(instance: Instance, includeTransform?:
3395
3418
 
3396
3419
  export declare function traverseRigInstance(instance: Instance): Instance[];
3397
3420
 
3421
+ export declare function traverseRigInstanceOld(instance: Instance): Instance[];
3422
+
3398
3423
  /** @category Mesh */
3399
3424
  export declare type Triangle = [Vec3, Vec3, Vec3];
3400
3425
 
package/dist/index.js CHANGED
@@ -27478,6 +27478,13 @@ class RBXSimpleView {
27478
27478
  }
27479
27479
  const magic = "<roblox!";
27480
27480
  const xmlMagic = "<roblox ";
27481
+ const PartType = {
27482
+ "Ball": 0,
27483
+ "Block": 1,
27484
+ "Cylinder": 2,
27485
+ "Wedge": 3,
27486
+ "CornerWedge": 4
27487
+ };
27481
27488
  const ParticleOrientation = {
27482
27489
  "FacingCamera": 0,
27483
27490
  "FacingCameraWorldUp": 1,
@@ -29885,6 +29892,7 @@ const FLAGS = {
29885
29892
  API_DOMAIN: "roblox.com",
29886
29893
  API_REQUEST_PREFIX: "",
29887
29894
  INCLUDE_REQUEST_CREDENTIALS_OVERRIDE: "include",
29895
+ API_REQUEST_RETRY: true,
29888
29896
  //assets
29889
29897
  ONLINE_ASSETS: false,
29890
29898
  ASSETS_PATH: "../assets/rbxasset/",
@@ -29987,6 +29995,7 @@ class InstanceWrapper {
29987
29995
  const newPropertyNames = this.instance.getPropertyNames();
29988
29996
  const hasAllProperties2 = this.static().requiredProperties.every((value) => newPropertyNames.includes(value));
29989
29997
  if (!hasAllProperties2) {
29998
+ log(true, "actual vs required:", newPropertyNames, this.static().requiredProperties);
29990
29999
  throw new Error("setup() does not add all properties listed in requiredProperties");
29991
30000
  }
29992
30001
  }
@@ -29997,6 +30006,18 @@ class InstanceWrapper {
29997
30006
  static() {
29998
30007
  return this.constructor;
29999
30008
  }
30009
+ static IsA(className) {
30010
+ if (this === InstanceWrapper) return className === "Instance";
30011
+ if (this.className === className) {
30012
+ return true;
30013
+ } else {
30014
+ const prototype = Object.getPrototypeOf(this);
30015
+ return prototype.IsA(className);
30016
+ }
30017
+ }
30018
+ IsA(className) {
30019
+ return this.static().IsA(className);
30020
+ }
30000
30021
  static register() {
30001
30022
  ClassNameToWrapper.set(this.className, this);
30002
30023
  log(false, "Registered InstanceWrapper:", ClassNameToWrapper);
@@ -30018,7 +30039,7 @@ class InstanceWrapper {
30018
30039
  preRender() {
30019
30040
  }
30020
30041
  }
30021
- const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
30042
+ const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
30022
30043
  __proto__: null,
30023
30044
  GetWrapperForInstance,
30024
30045
  InstanceWrapper
@@ -30548,6 +30569,9 @@ class Instance {
30548
30569
  }
30549
30570
  return wrapper;
30550
30571
  }
30572
+ get w() {
30573
+ return this.createWrapper();
30574
+ }
30551
30575
  addConnectionReference(connection) {
30552
30576
  if (!this._connectionReferences.includes(connection)) {
30553
30577
  this._connectionReferences.push(connection);
@@ -31053,7 +31077,7 @@ class RBX {
31053
31077
  case DataType.String: {
31054
31078
  let totalRead = 0;
31055
31079
  while (totalRead < valuesLength) {
31056
- if (StringBufferProperties.includes(prop.propertyName)) {
31080
+ if (StringBufferProperties.includes(prop.propertyName) && !FLAGS.SEARCH_FOR_STRING) {
31057
31081
  const length = chunkView.readUint32();
31058
31082
  prop.values.push(chunkView.buffer.slice(chunkView.viewOffset, chunkView.viewOffset + length - 1));
31059
31083
  chunkView.viewOffset += length;
@@ -35612,7 +35636,7 @@ async function RBLXPost(url, auth, body, attempt = 0, method = "POST") {
35612
35636
  xCsrfToken = "";
35613
35637
  }
35614
35638
  }
35615
- return new Promise((resolve) => {
35639
+ const response = await new Promise((resolve) => {
35616
35640
  const fetchHeaders = new Headers({
35617
35641
  "Content-Type": "application/json",
35618
35642
  "X-CSRF-TOKEN": xCsrfToken
@@ -35623,19 +35647,19 @@ async function RBLXPost(url, auth, body, attempt = 0, method = "POST") {
35623
35647
  credentials: FLAGS.INCLUDE_REQUEST_CREDENTIALS_OVERRIDE,
35624
35648
  headers: fetchHeaders,
35625
35649
  body
35626
- }).then((response) => {
35627
- if (response.status !== 200) {
35628
- if (response.status === 403 && attempt < 1) {
35629
- const responseToken = response.headers.get("x-csrf-token");
35650
+ }).then((response2) => {
35651
+ if (response2.status !== 200) {
35652
+ if (response2.status === 403 && attempt < 1) {
35653
+ const responseToken = response2.headers.get("x-csrf-token");
35630
35654
  if (responseToken && auth) {
35631
35655
  auth.TOKEN = responseToken;
35632
35656
  }
35633
35657
  resolve(RBLXPost(url, auth, body, attempt + 1, method));
35634
35658
  } else {
35635
- resolve(response);
35659
+ resolve(response2);
35636
35660
  }
35637
35661
  } else {
35638
- resolve(response);
35662
+ resolve(response2);
35639
35663
  }
35640
35664
  }).catch((error2) => {
35641
35665
  warn(true, error2);
@@ -35646,12 +35670,17 @@ async function RBLXPost(url, auth, body, attempt = 0, method = "POST") {
35646
35670
  resolve(new Response(JSON.stringify({ "error": error2 }), { status: 500 }));
35647
35671
  }
35648
35672
  });
35673
+ if (FLAGS.API_REQUEST_RETRY && response.status !== 200 && attempt === 0) {
35674
+ return RBLXPost(url, auth, body, attempt + 1, method);
35675
+ } else {
35676
+ return response;
35677
+ }
35649
35678
  }
35650
- async function RBLXGet(url, headers, includeCredentials = true) {
35679
+ async function RBLXGet(url, headers, includeCredentials = true, attempt = 0) {
35651
35680
  if (url.match(/https?:\/\/[a-z]+.roblox.com/)) {
35652
35681
  url = url.replace("roblox.com", FLAGS.API_DOMAIN);
35653
35682
  }
35654
- return new Promise((resolve) => {
35683
+ const response = await new Promise((resolve) => {
35655
35684
  let newHeaders = {
35656
35685
  "Content-Type": "application/json"
35657
35686
  };
@@ -35667,8 +35696,8 @@ async function RBLXGet(url, headers, includeCredentials = true) {
35667
35696
  credentials: includeCredentials ? FLAGS.INCLUDE_REQUEST_CREDENTIALS_OVERRIDE : void 0,
35668
35697
  headers: fetchHeaders,
35669
35698
  priority: FLAGS.ASSET_REQUEST_PRIORITY
35670
- }).then((response) => {
35671
- resolve(response);
35699
+ }).then((response2) => {
35700
+ resolve(response2);
35672
35701
  }).catch((error2) => {
35673
35702
  warn(true, error2);
35674
35703
  resolve(new Response(JSON.stringify({ "error": error2 }), { status: 500 }));
@@ -35678,6 +35707,11 @@ async function RBLXGet(url, headers, includeCredentials = true) {
35678
35707
  resolve(new Response(JSON.stringify({ "error": error2 }), { status: 500 }));
35679
35708
  }
35680
35709
  });
35710
+ if (FLAGS.API_REQUEST_RETRY && response.status !== 200 && attempt === 0) {
35711
+ return RBLXGet(url, headers, includeCredentials, attempt + 1);
35712
+ } else {
35713
+ return response;
35714
+ }
35681
35715
  }
35682
35716
  async function RBLXDelete(url, auth, body, attempt = 0) {
35683
35717
  return RBLXPost(url, auth, body, attempt, "DELETE");
@@ -41372,7 +41406,7 @@ const SCALE_Wide_R15 = {
41372
41406
  function GetCharacterParts(rig) {
41373
41407
  const characterParts = [];
41374
41408
  for (const item of rig.GetChildren()) {
41375
- if (item.className === "MeshPart" || item.className === "Part") {
41409
+ if (item.createWrapper()?.IsA("BasePart")) {
41376
41410
  characterParts.push(item);
41377
41411
  }
41378
41412
  }
@@ -42172,7 +42206,7 @@ function traverseRigCFrame(instance, includeTransform = false, applyRoot = false
42172
42206
  }
42173
42207
  return finalCF;
42174
42208
  }
42175
- function traverseRigInstance(instance) {
42209
+ function traverseRigInstanceOld(instance) {
42176
42210
  const children = [];
42177
42211
  let lastMotor6D = instance.FindFirstChildOfClass("Motor6D");
42178
42212
  if (!lastMotor6D) {
@@ -42189,6 +42223,72 @@ function traverseRigInstance(instance) {
42189
42223
  children.reverse();
42190
42224
  return children;
42191
42225
  }
42226
+ function traverseRigInstance(instance) {
42227
+ const children = [];
42228
+ let lastMotor6D = void 0;
42229
+ if (instance.className === "Motor6D" || instance.className === "Weld") {
42230
+ lastMotor6D = instance;
42231
+ } else {
42232
+ lastMotor6D = instance.FindFirstChildOfClass("Motor6D");
42233
+ if (!lastMotor6D) {
42234
+ lastMotor6D = instance.FindFirstChildOfClass("Weld");
42235
+ if (!lastMotor6D) {
42236
+ lastMotor6D = instance.FindFirstChildOfClass("ManualWeld");
42237
+ }
42238
+ }
42239
+ }
42240
+ while (lastMotor6D) {
42241
+ children.push(lastMotor6D.parent);
42242
+ const ogLastMotor6D = lastMotor6D;
42243
+ const ogPart0 = ogLastMotor6D.Prop("Part0");
42244
+ if (ogPart0 !== ogLastMotor6D.parent) {
42245
+ lastMotor6D = ogPart0?.FindFirstChildOfClass("Motor6D");
42246
+ if (!lastMotor6D) {
42247
+ lastMotor6D = ogPart0?.FindFirstChildOfClass("Weld");
42248
+ if (!lastMotor6D) {
42249
+ lastMotor6D = ogPart0?.FindFirstChildOfClass("ManualWeld");
42250
+ }
42251
+ }
42252
+ if (lastMotor6D && lastMotor6D.PropOrDefault("Part1", void 0) !== ogPart0) {
42253
+ const descendants = ogLastMotor6D.parent?.parent?.GetDescendants() || [];
42254
+ let foundMotor = false;
42255
+ for (const child of descendants) {
42256
+ if ((child.className === "Motor6D" || child.className === "Weld" || child.className === "ManualWeld") && child.PropOrDefault("Part1", void 0) === ogPart0) {
42257
+ lastMotor6D = child;
42258
+ foundMotor = true;
42259
+ break;
42260
+ }
42261
+ }
42262
+ if (!foundMotor) {
42263
+ lastMotor6D = void 0;
42264
+ }
42265
+ }
42266
+ } else {
42267
+ const descendants = ogLastMotor6D.parent?.parent?.GetDescendants() || [];
42268
+ let foundMotor = false;
42269
+ for (const child of descendants) {
42270
+ if ((child.className === "Motor6D" || child.className === "Weld" || child.className === "ManualWeld") && child.PropOrDefault("Part1", void 0) === ogPart0) {
42271
+ lastMotor6D = child;
42272
+ foundMotor = true;
42273
+ break;
42274
+ }
42275
+ }
42276
+ if (!foundMotor) {
42277
+ lastMotor6D = void 0;
42278
+ }
42279
+ }
42280
+ const part0 = lastMotor6D?.Prop("Part0");
42281
+ const part1 = lastMotor6D?.Prop("Part1");
42282
+ if (part0 === part1) {
42283
+ lastMotor6D = void 0;
42284
+ }
42285
+ if (children.length > 20) {
42286
+ lastMotor6D = void 0;
42287
+ }
42288
+ }
42289
+ children.reverse();
42290
+ return children;
42291
+ }
42192
42292
  const modelLayers = /* @__PURE__ */ new Map();
42193
42293
  function arrIsSameVector3(arr0, arr1) {
42194
42294
  if (arr0.length !== arr1.length) {
@@ -44529,11 +44629,11 @@ class MaterialDesc {
44529
44629
  this.layers.push(tShirtLayer);
44530
44630
  }
44531
44631
  }
44532
- addDecals(child, defaultUVType = "Decal") {
44632
+ addDecals(child, defaultUVType = "Decal", needsWrapTextureTranfer = false) {
44533
44633
  const decalsFound = [];
44534
44634
  const decals = child.GetChildren();
44535
44635
  for (const decal of decals) {
44536
- if (decal.className === "Decal") {
44636
+ if (decal.className === "Decal" && (!needsWrapTextureTranfer || decal.FindFirstChildOfClass("WrapTextureTransfer"))) {
44537
44637
  const decalTexture = decal.Property("Texture");
44538
44638
  const metallnessMap = decal.HasProperty("MetalnessMap") ? decal.Prop("MetalnessMap") : void 0;
44539
44639
  const normalMap = decal.HasProperty("NormalMap") ? decal.Prop("NormalMap") : void 0;
@@ -44631,6 +44731,10 @@ class MaterialDesc {
44631
44731
  } else if (specialMesh.Prop("TextureId").length > 0 && this.transparency === 0) {
44632
44732
  const colorLayer2 = new ColorLayer(new Color3(1, 1, 1));
44633
44733
  this.layers.push(colorLayer2);
44734
+ } else if (specialMesh.Prop("TextureId").length <= 0) {
44735
+ const partColor = child.Prop("Color").toColor3();
44736
+ const colorLayer2 = new ColorLayer(partColor);
44737
+ this.layers.push(colorLayer2);
44634
44738
  }
44635
44739
  const colorLayer = new TextureLayer();
44636
44740
  colorLayer.color = specialMesh.Property("TextureId");
@@ -44765,7 +44869,7 @@ class MaterialDesc {
44765
44869
  this.isDecal = true;
44766
44870
  this.transparent = true;
44767
44871
  if (child.parent) {
44768
- this.addDecals(child.parent, "Normal");
44872
+ this.addDecals(child.parent, "Normal", true);
44769
44873
  }
44770
44874
  }
44771
44875
  }
@@ -44781,7 +44885,7 @@ class FaceControlsWrapper extends InstanceWrapper {
44781
44885
  }
44782
44886
  }
44783
44887
  }
44784
- const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
44888
+ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
44785
44889
  __proto__: null,
44786
44890
  FaceControlsWrapper
44787
44891
  }, Symbol.toStringTag, { value: "Module" }));
@@ -46712,6 +46816,9 @@ class AnimatorWrapper extends InstanceWrapper {
46712
46816
  if (name === this.data.currentAnimation) {
46713
46817
  transitionTime = 0.15;
46714
46818
  }
46819
+ if (name === "jump" || name === "climb") {
46820
+ transitionTime = 0.1;
46821
+ }
46715
46822
  this.data.currentAnimation = name;
46716
46823
  let toPlayTrack = void 0;
46717
46824
  if (!name.startsWith("emote.") && !name.startsWith("id.")) {
@@ -47152,6 +47259,25 @@ const __vite_glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
47152
47259
  __proto__: null,
47153
47260
  AttachmentWrapper
47154
47261
  }, Symbol.toStringTag, { value: "Module" }));
47262
+ class BasePartWrapper extends InstanceWrapper {
47263
+ static className = "BasePart";
47264
+ static requiredProperties = [
47265
+ "Name",
47266
+ "CFrame",
47267
+ "size",
47268
+ "Transparency"
47269
+ ];
47270
+ setup() {
47271
+ if (!this.instance.HasProperty("Name")) this.instance.addProperty(new Property("Name", DataType.String), this.instance.className);
47272
+ if (!this.instance.HasProperty("CFrame")) this.instance.addProperty(new Property("CFrame", DataType.CFrame), new CFrame());
47273
+ if (!this.instance.HasProperty("size")) this.instance.addProperty(new Property("size", DataType.Vector3), new Vector32());
47274
+ if (!this.instance.HasProperty("Transparency")) this.instance.addProperty(new Property("Transparency", DataType.Float32), 0);
47275
+ }
47276
+ }
47277
+ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47278
+ __proto__: null,
47279
+ BasePartWrapper
47280
+ }, Symbol.toStringTag, { value: "Module" }));
47155
47281
  class BodyColorsWrapper extends InstanceWrapper {
47156
47282
  static className = "BodyColors";
47157
47283
  static requiredProperties = [
@@ -47196,7 +47322,7 @@ class BodyColorsWrapper extends InstanceWrapper {
47196
47322
  };
47197
47323
  const bodyParts = [];
47198
47324
  for (const child of rig.GetChildren()) {
47199
- if (child.className === "Part" || child.className === "MeshPart") {
47325
+ if (child.w?.IsA("BasePart")) {
47200
47326
  bodyParts.push(child);
47201
47327
  }
47202
47328
  }
@@ -47211,7 +47337,7 @@ class BodyColorsWrapper extends InstanceWrapper {
47211
47337
  }
47212
47338
  }
47213
47339
  }
47214
- const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47340
+ const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47215
47341
  __proto__: null,
47216
47342
  BodyColorsWrapper
47217
47343
  }, Symbol.toStringTag, { value: "Module" }));
@@ -47227,7 +47353,7 @@ class BodyPartDescriptionWrapper extends InstanceWrapper {
47227
47353
  if (!this.instance.HasProperty("Instance")) this.instance.addProperty(new Property("Instance", DataType.Referent), void 0);
47228
47354
  }
47229
47355
  }
47230
- const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47356
+ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47231
47357
  __proto__: null,
47232
47358
  BodyPartDescriptionWrapper
47233
47359
  }, Symbol.toStringTag, { value: "Module" }));
@@ -47252,7 +47378,7 @@ class DecalWrapper extends InstanceWrapper {
47252
47378
  if (!this.instance.HasProperty("UVScale")) this.instance.addProperty(new Property("UVScale", DataType.Vector2), new Vector22());
47253
47379
  }
47254
47380
  }
47255
- const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47381
+ const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47256
47382
  __proto__: null,
47257
47383
  DecalWrapper
47258
47384
  }, Symbol.toStringTag, { value: "Module" }));
@@ -47396,7 +47522,7 @@ class MakeupDescriptionWrapper extends InstanceWrapper {
47396
47522
  if (!this.instance.HasProperty("Instance")) this.instance.addProperty(new Property("Instance", DataType.Referent), void 0);
47397
47523
  }
47398
47524
  }
47399
- const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47525
+ const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47400
47526
  __proto__: null,
47401
47527
  MakeupDescriptionWrapper
47402
47528
  }, Symbol.toStringTag, { value: "Module" }));
@@ -48006,9 +48132,10 @@ class HumanoidDescriptionWrapper extends InstanceWrapper {
48006
48132
  const hrp = rig.FindFirstChild("HumanoidRootPart");
48007
48133
  if (hrp) {
48008
48134
  const cf = hrp.Prop("CFrame").clone();
48009
- cf.Position[1] = scaleInfo.stepHeight + hrp.Prop("Size").Y / 2;
48135
+ cf.Position[1] += scaleInfo.stepHeight - humanoid.Prop("HipHeight");
48010
48136
  hrp.setProperty("CFrame", cf);
48011
48137
  }
48138
+ humanoid.setProperty("HipHeight", scaleInfo.stepHeight);
48012
48139
  }
48013
48140
  for (const child of rig.GetDescendants()) {
48014
48141
  if (child.className === "Motor6D" || child.className === "Weld") {
@@ -48756,7 +48883,7 @@ class HumanoidDescriptionWrapper extends InstanceWrapper {
48756
48883
  return this.instance;
48757
48884
  }
48758
48885
  }
48759
- const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48886
+ const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48760
48887
  __proto__: null,
48761
48888
  HumanoidDescriptionWrapper
48762
48889
  }, Symbol.toStringTag, { value: "Module" }));
@@ -48859,17 +48986,32 @@ class WeldWrapper extends InstanceWrapper {
48859
48986
  }
48860
48987
  }
48861
48988
  }
48862
- const __vite_glob_0_18 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48989
+ const __vite_glob_0_22 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48863
48990
  __proto__: null,
48864
48991
  WeldWrapper
48865
48992
  }, Symbol.toStringTag, { value: "Module" }));
48866
48993
  class ManualWeldWrapper extends WeldWrapper {
48867
48994
  static className = "ManualWeld";
48868
48995
  }
48869
- const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48996
+ const __vite_glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48870
48997
  __proto__: null,
48871
48998
  ManualWeldWrapper
48872
48999
  }, Symbol.toStringTag, { value: "Module" }));
49000
+ class MeshPartWrapper extends BasePartWrapper {
49001
+ static className = "MeshPart";
49002
+ static requiredProperties = [
49003
+ ...super.requiredProperties,
49004
+ "DoubleSided"
49005
+ ];
49006
+ setup() {
49007
+ super.setup();
49008
+ if (!this.instance.HasProperty("DoubleSided")) this.instance.addProperty(new Property("DoubleSided", DataType.Bool), false);
49009
+ }
49010
+ }
49011
+ const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49012
+ __proto__: null,
49013
+ MeshPartWrapper
49014
+ }, Symbol.toStringTag, { value: "Module" }));
48873
49015
  class ModelWrapper extends InstanceWrapper {
48874
49016
  static className = "Model";
48875
49017
  static requiredProperties = ["Name", "PrimaryPart"];
@@ -48885,7 +49027,7 @@ class ModelWrapper extends InstanceWrapper {
48885
49027
  throw new Error("Model has no PrimaryPart");
48886
49028
  }
48887
49029
  }
48888
- const __vite_glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49030
+ const __vite_glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48889
49031
  __proto__: null,
48890
49032
  ModelWrapper
48891
49033
  }, Symbol.toStringTag, { value: "Module" }));
@@ -48900,10 +49042,25 @@ class Motor6DWrapper extends WeldWrapper {
48900
49042
  if (!this.instance.HasProperty("Transform")) this.instance.addProperty(new Property("Transform", DataType.CFrame), new CFrame());
48901
49043
  }
48902
49044
  }
48903
- const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49045
+ const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48904
49046
  __proto__: null,
48905
49047
  Motor6DWrapper
48906
49048
  }, Symbol.toStringTag, { value: "Module" }));
49049
+ class PartWrapper extends BasePartWrapper {
49050
+ static className = "Part";
49051
+ static requiredProperties = [
49052
+ ...super.requiredProperties,
49053
+ "shape"
49054
+ ];
49055
+ setup() {
49056
+ super.setup();
49057
+ if (!this.instance.HasProperty("shape")) this.instance.addProperty(new Property("shape", DataType.Enum), PartType.Block);
49058
+ }
49059
+ }
49060
+ const __vite_glob_0_17 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49061
+ __proto__: null,
49062
+ PartWrapper
49063
+ }, Symbol.toStringTag, { value: "Module" }));
48907
49064
  class SoundWrapperData {
48908
49065
  audioContext;
48909
49066
  gainNode;
@@ -49003,7 +49160,7 @@ class SoundWrapper extends InstanceWrapper {
49003
49160
  }
49004
49161
  }
49005
49162
  }
49006
- const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49163
+ const __vite_glob_0_19 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49007
49164
  __proto__: null,
49008
49165
  SoundWrapper
49009
49166
  }, Symbol.toStringTag, { value: "Module" }));
@@ -49068,7 +49225,7 @@ class ScriptWrapper extends InstanceWrapper {
49068
49225
  }
49069
49226
  }
49070
49227
  }
49071
- const __vite_glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49228
+ const __vite_glob_0_18 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49072
49229
  __proto__: null,
49073
49230
  ScriptWrapper
49074
49231
  }, Symbol.toStringTag, { value: "Module" }));
@@ -49125,11 +49282,18 @@ class ToolWrapper extends InstanceWrapper {
49125
49282
  }
49126
49283
  }
49127
49284
  }
49128
- const __vite_glob_0_17 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49285
+ const __vite_glob_0_20 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49129
49286
  __proto__: null,
49130
49287
  ToolWrapper
49131
49288
  }, Symbol.toStringTag, { value: "Module" }));
49132
- const modules$1 = /* @__PURE__ */ Object.assign({ "./instance/Accessory.ts": __vite_glob_0_0$1, "./instance/AccessoryDescription.ts": __vite_glob_0_1$1, "./instance/AnimationConstraint.ts": __vite_glob_0_2$1, "./instance/Animator.ts": __vite_glob_0_3, "./instance/Attachment.ts": __vite_glob_0_4, "./instance/BodyColors.ts": __vite_glob_0_5, "./instance/BodyPartDescription.ts": __vite_glob_0_6, "./instance/Decal.ts": __vite_glob_0_7, "./instance/FaceControls.ts": __vite_glob_0_8, "./instance/HumanoidDescription.ts": __vite_glob_0_9, "./instance/InstanceWrapper.ts": __vite_glob_0_10, "./instance/MakeupDescription.ts": __vite_glob_0_11, "./instance/ManualWeld.ts": __vite_glob_0_12, "./instance/Model.ts": __vite_glob_0_13, "./instance/Motor6D.ts": __vite_glob_0_14, "./instance/Script.ts": __vite_glob_0_15, "./instance/Sound.ts": __vite_glob_0_16, "./instance/Tool.ts": __vite_glob_0_17, "./instance/Weld.ts": __vite_glob_0_18 });
49289
+ class WedgePartWrapper extends BasePartWrapper {
49290
+ static className = "WedgePart";
49291
+ }
49292
+ const __vite_glob_0_21 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49293
+ __proto__: null,
49294
+ WedgePartWrapper
49295
+ }, Symbol.toStringTag, { value: "Module" }));
49296
+ const modules$1 = /* @__PURE__ */ Object.assign({ "./instance/Accessory.ts": __vite_glob_0_0$1, "./instance/AccessoryDescription.ts": __vite_glob_0_1$1, "./instance/AnimationConstraint.ts": __vite_glob_0_2$1, "./instance/Animator.ts": __vite_glob_0_3, "./instance/Attachment.ts": __vite_glob_0_4, "./instance/BasePart.ts": __vite_glob_0_5, "./instance/BodyColors.ts": __vite_glob_0_6, "./instance/BodyPartDescription.ts": __vite_glob_0_7, "./instance/Decal.ts": __vite_glob_0_8, "./instance/FaceControls.ts": __vite_glob_0_9, "./instance/HumanoidDescription.ts": __vite_glob_0_10, "./instance/InstanceWrapper.ts": __vite_glob_0_11, "./instance/MakeupDescription.ts": __vite_glob_0_12, "./instance/ManualWeld.ts": __vite_glob_0_13, "./instance/MeshPart.ts": __vite_glob_0_14, "./instance/Model.ts": __vite_glob_0_15, "./instance/Motor6D.ts": __vite_glob_0_16, "./instance/Part.ts": __vite_glob_0_17, "./instance/Script.ts": __vite_glob_0_18, "./instance/Sound.ts": __vite_glob_0_19, "./instance/Tool.ts": __vite_glob_0_20, "./instance/WedgePart.ts": __vite_glob_0_21, "./instance/Weld.ts": __vite_glob_0_22 });
49133
49297
  function RegisterWrappers() {
49134
49298
  for (const module of Object.values(modules$1)) {
49135
49299
  for (const exprt of Object.values(module)) {
@@ -49513,9 +49677,12 @@ class EmitterDesc extends DisposableDesc {
49513
49677
  const velocityLocal = velocityOriginal.applyQuaternion(groupDesc.getNormalQuaternionForVelocity());
49514
49678
  const worldVelocity = velocityLocal.applyQuaternion(new Quaternion().setFromRotationMatrix(groupDesc.cframe.getTHREEMatrix()));
49515
49679
  const worldVelocityRoblox = new Vector32(...worldVelocity.toArray());
49680
+ let localPos = groupDesc.getRandomLocalPos();
49681
+ localPos = localPos.add(this.offset);
49682
+ const worldPos = groupDesc.toWorldSpace(localPos);
49516
49683
  const particle = new Particle(
49517
49684
  randomBetween(this.lifetime.Min, this.lifetime.Max),
49518
- groupDesc.getRandomWorldPos().add(this.offset),
49685
+ worldPos,
49519
49686
  randomBetween(this.rotation.Min, this.rotation.Max),
49520
49687
  worldVelocityRoblox,
49521
49688
  randomBetween(this.rotationSpeed.Min, this.rotationSpeed.Max)
@@ -49765,7 +49932,8 @@ class EmitterGroupDesc extends RenderDesc {
49765
49932
  rate: 5,
49766
49933
  lifetime: new NumberRange(1.7, 1.7),
49767
49934
  timeScale: child.PropOrDefault("TimeScale", 1),
49768
- color: ColorSequence.fromColor(color)
49935
+ color: ColorSequence.fromColor(color),
49936
+ offset: new Vector32(0, 4, 0)
49769
49937
  }));
49770
49938
  }
49771
49939
  fromFire(child) {
@@ -50899,7 +51067,7 @@ function getExtentsForParts(parts, includeTransform) {
50899
51067
  let lowerExtents = new Vector32(0, 0, 0);
50900
51068
  let higherExtents = new Vector32(0, 0, 0);
50901
51069
  for (const child of parts) {
50902
- if (child.className === "Part" || child.className === "MeshPart") {
51070
+ if (child.createWrapper()?.IsA("BasePart")) {
50903
51071
  const cframe = traverseRigCFrame(child, includeTransform, true);
50904
51072
  const size = child.Prop("Size");
50905
51073
  const corners = getCorners(cframe, size);
@@ -50916,7 +51084,7 @@ function getExtents(cframe, parts) {
50916
51084
  let lowerExtents = new Vector32(0, 0, 0);
50917
51085
  let higherExtents = new Vector32(0, 0, 0);
50918
51086
  for (const child of parts) {
50919
- if (child.className === "Part" || child.className === "MeshPart") {
51087
+ if (child.createWrapper()?.IsA("BasePart")) {
50920
51088
  const partCF = child.Prop("CFrame");
50921
51089
  const partSize = child.Prop("Size");
50922
51090
  const corners = getCorners(inverseCF.multiply(partCF), partSize);
@@ -50974,7 +51142,7 @@ function getHeadExtents(rig) {
50974
51142
  function getRigExtentsWorld(rig) {
50975
51143
  const rigParts = [];
50976
51144
  for (const child of rig.GetDescendants()) {
50977
- if (child.className === "Part" || child.className === "MeshPart") {
51145
+ if (child.createWrapper()?.IsA("BasePart")) {
50978
51146
  rigParts.push(child);
50979
51147
  }
50980
51148
  }
@@ -51084,6 +51252,14 @@ class OutfitRenderer {
51084
51252
  animationFPS = 60;
51085
51253
  deltaTimeMultiplier = 1;
51086
51254
  renderScene = RBXRenderer.firstScene;
51255
+ /**Event is fired if a new outfit failed to load
51256
+ * @returns OutfitRendererErrorType
51257
+ */
51258
+ onError = new Event();
51259
+ /**Event is fired if a new outfit successfully loaded
51260
+ * @returns void
51261
+ */
51262
+ onSuccess = new Event();
51087
51263
  /**
51088
51264
  * Creates a new OutfitRenderer which makes it easy to render outfits
51089
51265
  * @param auth The authentication object, you should have one you use for everything
@@ -51117,6 +51293,7 @@ class OutfitRenderer {
51117
51293
  RBXRenderer.addInstance(this.currentRig, this.auth, this.renderScene);
51118
51294
  resolve(newRig);
51119
51295
  } else {
51296
+ this.onError.Fire("rig");
51120
51297
  resolve(result);
51121
51298
  }
51122
51299
  });
@@ -51157,6 +51334,7 @@ class OutfitRenderer {
51157
51334
  }
51158
51335
  }
51159
51336
  if (result instanceof Instance) {
51337
+ this.onSuccess.Fire();
51160
51338
  if (this.hasNewUpdate) {
51161
51339
  this.hasNewUpdate = false;
51162
51340
  this._updateOutfit();
@@ -51164,6 +51342,7 @@ class OutfitRenderer {
51164
51342
  } else {
51165
51343
  const oldHumanoidDescription = humanoid.FindFirstChildOfClass("HumanoidDescription");
51166
51344
  oldHumanoidDescription?.Destroy();
51345
+ this.onError.Fire("humanoidDescription");
51167
51346
  }
51168
51347
  });
51169
51348
  } else {
@@ -51493,6 +51672,7 @@ export {
51493
51672
  Outfit,
51494
51673
  OutfitOrigin,
51495
51674
  OutfitRenderer,
51675
+ PartType,
51496
51676
  ParticleEmitterShapeInOut,
51497
51677
  ParticleOrientation,
51498
51678
  Property,
@@ -51642,6 +51822,7 @@ export {
51642
51822
  transferSkeleton,
51643
51823
  traverseRigCFrame,
51644
51824
  traverseRigInstance,
51825
+ traverseRigInstanceOld,
51645
51826
  triangleNormal,
51646
51827
  versionToNumber,
51647
51828
  vertPosToChunkPos,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roavatar-renderer",
3
- "version": "1.5.1",
3
+ "version": "1.5.3",
4
4
  "description": "A renderer for Roblox avatars, used by the RoAvatar extension.",
5
5
  "author": "steinan",
6
6
  "type": "module",