roavatar-renderer 1.5.1 → 1.5.2

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
 
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
  }
@@ -44529,11 +44563,11 @@ class MaterialDesc {
44529
44563
  this.layers.push(tShirtLayer);
44530
44564
  }
44531
44565
  }
44532
- addDecals(child, defaultUVType = "Decal") {
44566
+ addDecals(child, defaultUVType = "Decal", needsWrapTextureTranfer = false) {
44533
44567
  const decalsFound = [];
44534
44568
  const decals = child.GetChildren();
44535
44569
  for (const decal of decals) {
44536
- if (decal.className === "Decal") {
44570
+ if (decal.className === "Decal" && (!needsWrapTextureTranfer || decal.FindFirstChildOfClass("WrapTextureTransfer"))) {
44537
44571
  const decalTexture = decal.Property("Texture");
44538
44572
  const metallnessMap = decal.HasProperty("MetalnessMap") ? decal.Prop("MetalnessMap") : void 0;
44539
44573
  const normalMap = decal.HasProperty("NormalMap") ? decal.Prop("NormalMap") : void 0;
@@ -44631,6 +44665,10 @@ class MaterialDesc {
44631
44665
  } else if (specialMesh.Prop("TextureId").length > 0 && this.transparency === 0) {
44632
44666
  const colorLayer2 = new ColorLayer(new Color3(1, 1, 1));
44633
44667
  this.layers.push(colorLayer2);
44668
+ } else if (specialMesh.Prop("TextureId").length <= 0) {
44669
+ const partColor = child.Prop("Color").toColor3();
44670
+ const colorLayer2 = new ColorLayer(partColor);
44671
+ this.layers.push(colorLayer2);
44634
44672
  }
44635
44673
  const colorLayer = new TextureLayer();
44636
44674
  colorLayer.color = specialMesh.Property("TextureId");
@@ -44765,7 +44803,7 @@ class MaterialDesc {
44765
44803
  this.isDecal = true;
44766
44804
  this.transparent = true;
44767
44805
  if (child.parent) {
44768
- this.addDecals(child.parent, "Normal");
44806
+ this.addDecals(child.parent, "Normal", true);
44769
44807
  }
44770
44808
  }
44771
44809
  }
@@ -44781,7 +44819,7 @@ class FaceControlsWrapper extends InstanceWrapper {
44781
44819
  }
44782
44820
  }
44783
44821
  }
44784
- const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
44822
+ const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
44785
44823
  __proto__: null,
44786
44824
  FaceControlsWrapper
44787
44825
  }, Symbol.toStringTag, { value: "Module" }));
@@ -46712,6 +46750,9 @@ class AnimatorWrapper extends InstanceWrapper {
46712
46750
  if (name === this.data.currentAnimation) {
46713
46751
  transitionTime = 0.15;
46714
46752
  }
46753
+ if (name === "jump" || name === "climb") {
46754
+ transitionTime = 0.1;
46755
+ }
46715
46756
  this.data.currentAnimation = name;
46716
46757
  let toPlayTrack = void 0;
46717
46758
  if (!name.startsWith("emote.") && !name.startsWith("id.")) {
@@ -47152,6 +47193,25 @@ const __vite_glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
47152
47193
  __proto__: null,
47153
47194
  AttachmentWrapper
47154
47195
  }, Symbol.toStringTag, { value: "Module" }));
47196
+ class BasePartWrapper extends InstanceWrapper {
47197
+ static className = "BasePart";
47198
+ static requiredProperties = [
47199
+ "Name",
47200
+ "CFrame",
47201
+ "size",
47202
+ "Transparency"
47203
+ ];
47204
+ setup() {
47205
+ if (!this.instance.HasProperty("Name")) this.instance.addProperty(new Property("Name", DataType.String), this.instance.className);
47206
+ if (!this.instance.HasProperty("CFrame")) this.instance.addProperty(new Property("CFrame", DataType.CFrame), new CFrame());
47207
+ if (!this.instance.HasProperty("size")) this.instance.addProperty(new Property("size", DataType.Vector3), new Vector32());
47208
+ if (!this.instance.HasProperty("Transparency")) this.instance.addProperty(new Property("Transparency", DataType.Float32), 0);
47209
+ }
47210
+ }
47211
+ const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47212
+ __proto__: null,
47213
+ BasePartWrapper
47214
+ }, Symbol.toStringTag, { value: "Module" }));
47155
47215
  class BodyColorsWrapper extends InstanceWrapper {
47156
47216
  static className = "BodyColors";
47157
47217
  static requiredProperties = [
@@ -47196,7 +47256,7 @@ class BodyColorsWrapper extends InstanceWrapper {
47196
47256
  };
47197
47257
  const bodyParts = [];
47198
47258
  for (const child of rig.GetChildren()) {
47199
- if (child.className === "Part" || child.className === "MeshPart") {
47259
+ if (child.w?.IsA("BasePart")) {
47200
47260
  bodyParts.push(child);
47201
47261
  }
47202
47262
  }
@@ -47211,7 +47271,7 @@ class BodyColorsWrapper extends InstanceWrapper {
47211
47271
  }
47212
47272
  }
47213
47273
  }
47214
- const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47274
+ const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47215
47275
  __proto__: null,
47216
47276
  BodyColorsWrapper
47217
47277
  }, Symbol.toStringTag, { value: "Module" }));
@@ -47227,7 +47287,7 @@ class BodyPartDescriptionWrapper extends InstanceWrapper {
47227
47287
  if (!this.instance.HasProperty("Instance")) this.instance.addProperty(new Property("Instance", DataType.Referent), void 0);
47228
47288
  }
47229
47289
  }
47230
- const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47290
+ const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47231
47291
  __proto__: null,
47232
47292
  BodyPartDescriptionWrapper
47233
47293
  }, Symbol.toStringTag, { value: "Module" }));
@@ -47252,7 +47312,7 @@ class DecalWrapper extends InstanceWrapper {
47252
47312
  if (!this.instance.HasProperty("UVScale")) this.instance.addProperty(new Property("UVScale", DataType.Vector2), new Vector22());
47253
47313
  }
47254
47314
  }
47255
- const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47315
+ const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47256
47316
  __proto__: null,
47257
47317
  DecalWrapper
47258
47318
  }, Symbol.toStringTag, { value: "Module" }));
@@ -47396,7 +47456,7 @@ class MakeupDescriptionWrapper extends InstanceWrapper {
47396
47456
  if (!this.instance.HasProperty("Instance")) this.instance.addProperty(new Property("Instance", DataType.Referent), void 0);
47397
47457
  }
47398
47458
  }
47399
- const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47459
+ const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
47400
47460
  __proto__: null,
47401
47461
  MakeupDescriptionWrapper
47402
47462
  }, Symbol.toStringTag, { value: "Module" }));
@@ -48006,9 +48066,10 @@ class HumanoidDescriptionWrapper extends InstanceWrapper {
48006
48066
  const hrp = rig.FindFirstChild("HumanoidRootPart");
48007
48067
  if (hrp) {
48008
48068
  const cf = hrp.Prop("CFrame").clone();
48009
- cf.Position[1] = scaleInfo.stepHeight + hrp.Prop("Size").Y / 2;
48069
+ cf.Position[1] += scaleInfo.stepHeight - humanoid.Prop("HipHeight");
48010
48070
  hrp.setProperty("CFrame", cf);
48011
48071
  }
48072
+ humanoid.setProperty("HipHeight", scaleInfo.stepHeight);
48012
48073
  }
48013
48074
  for (const child of rig.GetDescendants()) {
48014
48075
  if (child.className === "Motor6D" || child.className === "Weld") {
@@ -48756,7 +48817,7 @@ class HumanoidDescriptionWrapper extends InstanceWrapper {
48756
48817
  return this.instance;
48757
48818
  }
48758
48819
  }
48759
- const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48820
+ const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48760
48821
  __proto__: null,
48761
48822
  HumanoidDescriptionWrapper
48762
48823
  }, Symbol.toStringTag, { value: "Module" }));
@@ -48859,17 +48920,32 @@ class WeldWrapper extends InstanceWrapper {
48859
48920
  }
48860
48921
  }
48861
48922
  }
48862
- const __vite_glob_0_18 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48923
+ const __vite_glob_0_22 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48863
48924
  __proto__: null,
48864
48925
  WeldWrapper
48865
48926
  }, Symbol.toStringTag, { value: "Module" }));
48866
48927
  class ManualWeldWrapper extends WeldWrapper {
48867
48928
  static className = "ManualWeld";
48868
48929
  }
48869
- const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48930
+ const __vite_glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48870
48931
  __proto__: null,
48871
48932
  ManualWeldWrapper
48872
48933
  }, Symbol.toStringTag, { value: "Module" }));
48934
+ class MeshPartWrapper extends BasePartWrapper {
48935
+ static className = "MeshPart";
48936
+ static requiredProperties = [
48937
+ ...super.requiredProperties,
48938
+ "DoubleSided"
48939
+ ];
48940
+ setup() {
48941
+ super.setup();
48942
+ if (!this.instance.HasProperty("DoubleSided")) this.instance.addProperty(new Property("DoubleSided", DataType.Bool), false);
48943
+ }
48944
+ }
48945
+ const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48946
+ __proto__: null,
48947
+ MeshPartWrapper
48948
+ }, Symbol.toStringTag, { value: "Module" }));
48873
48949
  class ModelWrapper extends InstanceWrapper {
48874
48950
  static className = "Model";
48875
48951
  static requiredProperties = ["Name", "PrimaryPart"];
@@ -48885,7 +48961,7 @@ class ModelWrapper extends InstanceWrapper {
48885
48961
  throw new Error("Model has no PrimaryPart");
48886
48962
  }
48887
48963
  }
48888
- const __vite_glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48964
+ const __vite_glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48889
48965
  __proto__: null,
48890
48966
  ModelWrapper
48891
48967
  }, Symbol.toStringTag, { value: "Module" }));
@@ -48900,10 +48976,25 @@ class Motor6DWrapper extends WeldWrapper {
48900
48976
  if (!this.instance.HasProperty("Transform")) this.instance.addProperty(new Property("Transform", DataType.CFrame), new CFrame());
48901
48977
  }
48902
48978
  }
48903
- const __vite_glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48979
+ const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48904
48980
  __proto__: null,
48905
48981
  Motor6DWrapper
48906
48982
  }, Symbol.toStringTag, { value: "Module" }));
48983
+ class PartWrapper extends BasePartWrapper {
48984
+ static className = "Part";
48985
+ static requiredProperties = [
48986
+ ...super.requiredProperties,
48987
+ "shape"
48988
+ ];
48989
+ setup() {
48990
+ super.setup();
48991
+ if (!this.instance.HasProperty("shape")) this.instance.addProperty(new Property("shape", DataType.Enum), PartType.Block);
48992
+ }
48993
+ }
48994
+ const __vite_glob_0_17 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
48995
+ __proto__: null,
48996
+ PartWrapper
48997
+ }, Symbol.toStringTag, { value: "Module" }));
48907
48998
  class SoundWrapperData {
48908
48999
  audioContext;
48909
49000
  gainNode;
@@ -49003,7 +49094,7 @@ class SoundWrapper extends InstanceWrapper {
49003
49094
  }
49004
49095
  }
49005
49096
  }
49006
- const __vite_glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49097
+ const __vite_glob_0_19 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49007
49098
  __proto__: null,
49008
49099
  SoundWrapper
49009
49100
  }, Symbol.toStringTag, { value: "Module" }));
@@ -49068,7 +49159,7 @@ class ScriptWrapper extends InstanceWrapper {
49068
49159
  }
49069
49160
  }
49070
49161
  }
49071
- const __vite_glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49162
+ const __vite_glob_0_18 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49072
49163
  __proto__: null,
49073
49164
  ScriptWrapper
49074
49165
  }, Symbol.toStringTag, { value: "Module" }));
@@ -49125,11 +49216,18 @@ class ToolWrapper extends InstanceWrapper {
49125
49216
  }
49126
49217
  }
49127
49218
  }
49128
- const __vite_glob_0_17 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49219
+ const __vite_glob_0_20 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49129
49220
  __proto__: null,
49130
49221
  ToolWrapper
49131
49222
  }, 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 });
49223
+ class WedgePartWrapper extends BasePartWrapper {
49224
+ static className = "WedgePart";
49225
+ }
49226
+ const __vite_glob_0_21 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
49227
+ __proto__: null,
49228
+ WedgePartWrapper
49229
+ }, Symbol.toStringTag, { value: "Module" }));
49230
+ 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
49231
  function RegisterWrappers() {
49134
49232
  for (const module of Object.values(modules$1)) {
49135
49233
  for (const exprt of Object.values(module)) {
@@ -49513,9 +49611,12 @@ class EmitterDesc extends DisposableDesc {
49513
49611
  const velocityLocal = velocityOriginal.applyQuaternion(groupDesc.getNormalQuaternionForVelocity());
49514
49612
  const worldVelocity = velocityLocal.applyQuaternion(new Quaternion().setFromRotationMatrix(groupDesc.cframe.getTHREEMatrix()));
49515
49613
  const worldVelocityRoblox = new Vector32(...worldVelocity.toArray());
49614
+ let localPos = groupDesc.getRandomLocalPos();
49615
+ localPos = localPos.add(this.offset);
49616
+ const worldPos = groupDesc.toWorldSpace(localPos);
49516
49617
  const particle = new Particle(
49517
49618
  randomBetween(this.lifetime.Min, this.lifetime.Max),
49518
- groupDesc.getRandomWorldPos().add(this.offset),
49619
+ worldPos,
49519
49620
  randomBetween(this.rotation.Min, this.rotation.Max),
49520
49621
  worldVelocityRoblox,
49521
49622
  randomBetween(this.rotationSpeed.Min, this.rotationSpeed.Max)
@@ -49765,7 +49866,8 @@ class EmitterGroupDesc extends RenderDesc {
49765
49866
  rate: 5,
49766
49867
  lifetime: new NumberRange(1.7, 1.7),
49767
49868
  timeScale: child.PropOrDefault("TimeScale", 1),
49768
- color: ColorSequence.fromColor(color)
49869
+ color: ColorSequence.fromColor(color),
49870
+ offset: new Vector32(0, 4, 0)
49769
49871
  }));
49770
49872
  }
49771
49873
  fromFire(child) {
@@ -50899,7 +51001,7 @@ function getExtentsForParts(parts, includeTransform) {
50899
51001
  let lowerExtents = new Vector32(0, 0, 0);
50900
51002
  let higherExtents = new Vector32(0, 0, 0);
50901
51003
  for (const child of parts) {
50902
- if (child.className === "Part" || child.className === "MeshPart") {
51004
+ if (child.createWrapper()?.IsA("BasePart")) {
50903
51005
  const cframe = traverseRigCFrame(child, includeTransform, true);
50904
51006
  const size = child.Prop("Size");
50905
51007
  const corners = getCorners(cframe, size);
@@ -50916,7 +51018,7 @@ function getExtents(cframe, parts) {
50916
51018
  let lowerExtents = new Vector32(0, 0, 0);
50917
51019
  let higherExtents = new Vector32(0, 0, 0);
50918
51020
  for (const child of parts) {
50919
- if (child.className === "Part" || child.className === "MeshPart") {
51021
+ if (child.createWrapper()?.IsA("BasePart")) {
50920
51022
  const partCF = child.Prop("CFrame");
50921
51023
  const partSize = child.Prop("Size");
50922
51024
  const corners = getCorners(inverseCF.multiply(partCF), partSize);
@@ -50974,7 +51076,7 @@ function getHeadExtents(rig) {
50974
51076
  function getRigExtentsWorld(rig) {
50975
51077
  const rigParts = [];
50976
51078
  for (const child of rig.GetDescendants()) {
50977
- if (child.className === "Part" || child.className === "MeshPart") {
51079
+ if (child.createWrapper()?.IsA("BasePart")) {
50978
51080
  rigParts.push(child);
50979
51081
  }
50980
51082
  }
@@ -51084,6 +51186,14 @@ class OutfitRenderer {
51084
51186
  animationFPS = 60;
51085
51187
  deltaTimeMultiplier = 1;
51086
51188
  renderScene = RBXRenderer.firstScene;
51189
+ /**Event is fired if a new outfit failed to load
51190
+ * @returns OutfitRendererErrorType
51191
+ */
51192
+ onError = new Event();
51193
+ /**Event is fired if a new outfit successfully loaded
51194
+ * @returns void
51195
+ */
51196
+ onSuccess = new Event();
51087
51197
  /**
51088
51198
  * Creates a new OutfitRenderer which makes it easy to render outfits
51089
51199
  * @param auth The authentication object, you should have one you use for everything
@@ -51117,6 +51227,7 @@ class OutfitRenderer {
51117
51227
  RBXRenderer.addInstance(this.currentRig, this.auth, this.renderScene);
51118
51228
  resolve(newRig);
51119
51229
  } else {
51230
+ this.onError.Fire("rig");
51120
51231
  resolve(result);
51121
51232
  }
51122
51233
  });
@@ -51157,6 +51268,7 @@ class OutfitRenderer {
51157
51268
  }
51158
51269
  }
51159
51270
  if (result instanceof Instance) {
51271
+ this.onSuccess.Fire();
51160
51272
  if (this.hasNewUpdate) {
51161
51273
  this.hasNewUpdate = false;
51162
51274
  this._updateOutfit();
@@ -51164,6 +51276,7 @@ class OutfitRenderer {
51164
51276
  } else {
51165
51277
  const oldHumanoidDescription = humanoid.FindFirstChildOfClass("HumanoidDescription");
51166
51278
  oldHumanoidDescription?.Destroy();
51279
+ this.onError.Fire("humanoidDescription");
51167
51280
  }
51168
51281
  });
51169
51282
  } else {
@@ -51493,6 +51606,7 @@ export {
51493
51606
  Outfit,
51494
51607
  OutfitOrigin,
51495
51608
  OutfitRenderer,
51609
+ PartType,
51496
51610
  ParticleEmitterShapeInOut,
51497
51611
  ParticleOrientation,
51498
51612
  Property,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roavatar-renderer",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "A renderer for Roblox avatars, used by the RoAvatar extension.",
5
5
  "author": "steinan",
6
6
  "type": "module",