roavatar-renderer 1.5.2 → 1.5.4

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
@@ -3418,6 +3418,8 @@ export declare function traverseRigCFrame(instance: Instance, includeTransform?:
3418
3418
 
3419
3419
  export declare function traverseRigInstance(instance: Instance): Instance[];
3420
3420
 
3421
+ export declare function traverseRigInstanceOld(instance: Instance): Instance[];
3422
+
3421
3423
  /** @category Mesh */
3422
3424
  export declare type Triangle = [Vec3, Vec3, Vec3];
3423
3425
 
package/dist/index.js CHANGED
@@ -42206,7 +42206,7 @@ function traverseRigCFrame(instance, includeTransform = false, applyRoot = false
42206
42206
  }
42207
42207
  return finalCF;
42208
42208
  }
42209
- function traverseRigInstance(instance) {
42209
+ function traverseRigInstanceOld(instance) {
42210
42210
  const children = [];
42211
42211
  let lastMotor6D = instance.FindFirstChildOfClass("Motor6D");
42212
42212
  if (!lastMotor6D) {
@@ -42223,6 +42223,72 @@ function traverseRigInstance(instance) {
42223
42223
  children.reverse();
42224
42224
  return children;
42225
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
+ }
42226
42292
  const modelLayers = /* @__PURE__ */ new Map();
42227
42293
  function arrIsSameVector3(arr0, arr1) {
42228
42294
  if (arr0.length !== arr1.length) {
@@ -47181,9 +47247,12 @@ class AttachmentWrapper extends InstanceWrapper {
47181
47247
  }
47182
47248
  getWorldCFrame() {
47183
47249
  if (this.instance.parent) {
47184
- if (this.instance.parent.className.includes("Part")) {
47250
+ if (this.instance.parent.w?.IsA("BasePart")) {
47185
47251
  const parentCF = this.instance.parent.PropOrDefault("CFrame", new CFrame());
47186
47252
  return parentCF.multiply(this.instance.Prop("CFrame"));
47253
+ } else if (this.instance.parent.w?.IsA("Attachment")) {
47254
+ const w = this.instance.parent.w;
47255
+ return w.getWorldCFrame().multiply(this.instance.Prop("CFrame"));
47187
47256
  }
47188
47257
  }
47189
47258
  return this.instance.Prop("CFrame");
@@ -48155,6 +48224,11 @@ class HumanoidDescriptionWrapper extends InstanceWrapper {
48155
48224
  if (!FLAGS.AVATAR_JOINT_UPGRADE) {
48156
48225
  moveAttachmentsToBase(child);
48157
48226
  }
48227
+ for (const childChild of child.GetChildren()) {
48228
+ if (childChild.w?.IsA("Weld") || childChild.w?.IsA("AnimationConstraint")) {
48229
+ childChild.Destroy();
48230
+ }
48231
+ }
48158
48232
  replaceBodyPart(rig, child);
48159
48233
  }
48160
48234
  }
@@ -51756,6 +51830,7 @@ export {
51756
51830
  transferSkeleton,
51757
51831
  traverseRigCFrame,
51758
51832
  traverseRigInstance,
51833
+ traverseRigInstanceOld,
51759
51834
  triangleNormal,
51760
51835
  versionToNumber,
51761
51836
  vertPosToChunkPos,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roavatar-renderer",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "description": "A renderer for Roblox avatars, used by the RoAvatar extension.",
5
5
  "author": "steinan",
6
6
  "type": "module",