loomlarge 0.1.6 → 0.2.0

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.cts CHANGED
@@ -425,6 +425,11 @@ declare class LoomLargeThree implements LoomLarge {
425
425
  private applyCompositeRotation;
426
426
  private resolveBones;
427
427
  private combineHandles;
428
+ /**
429
+ * Apply render order and material settings from CC4_MESHES to all meshes.
430
+ * This ensures proper layering (e.g., hair renders on top of eyebrows).
431
+ */
432
+ private applyMeshMaterialSettings;
428
433
  }
429
434
  /**
430
435
  * Helper function to collect meshes with morph targets from a scene.
package/dist/index.d.ts CHANGED
@@ -425,6 +425,11 @@ declare class LoomLargeThree implements LoomLarge {
425
425
  private applyCompositeRotation;
426
426
  private resolveBones;
427
427
  private combineHandles;
428
+ /**
429
+ * Apply render order and material settings from CC4_MESHES to all meshes.
430
+ * This ensures proper layering (e.g., hair renders on top of eyebrows).
431
+ */
432
+ private applyMeshMaterialSettings;
428
433
  }
429
434
  /**
430
435
  * Helper function to collect meshes with morph targets from a scene.
package/dist/index.js CHANGED
@@ -715,6 +715,7 @@ var _LoomLargeThree = class _LoomLargeThree {
715
715
  this.rigReady = true;
716
716
  this.missingBoneWarnings.clear();
717
717
  this.initBoneRotations();
718
+ this.applyMeshMaterialSettings(model);
718
719
  }
719
720
  update(deltaSeconds) {
720
721
  const dtSeconds = Math.max(0, deltaSeconds || 0);
@@ -1169,6 +1170,35 @@ var _LoomLargeThree = class _LoomLargeThree {
1169
1170
  cancel: () => handles.forEach((h) => h.cancel())
1170
1171
  };
1171
1172
  }
1173
+ /**
1174
+ * Apply render order and material settings from CC4_MESHES to all meshes.
1175
+ * This ensures proper layering (e.g., hair renders on top of eyebrows).
1176
+ */
1177
+ applyMeshMaterialSettings(root) {
1178
+ root.traverse((obj) => {
1179
+ if (!obj.isMesh || !obj.name) return;
1180
+ const meshInfo = CC4_MESHES[obj.name];
1181
+ if (!meshInfo?.material) return;
1182
+ const settings = meshInfo.material;
1183
+ if (typeof settings.renderOrder === "number") {
1184
+ obj.renderOrder = settings.renderOrder;
1185
+ }
1186
+ if (obj.material) {
1187
+ if (typeof settings.transparent === "boolean") {
1188
+ obj.material.transparent = settings.transparent;
1189
+ }
1190
+ if (typeof settings.opacity === "number") {
1191
+ obj.material.opacity = settings.opacity;
1192
+ }
1193
+ if (typeof settings.depthWrite === "boolean") {
1194
+ obj.material.depthWrite = settings.depthWrite;
1195
+ }
1196
+ if (typeof settings.depthTest === "boolean") {
1197
+ obj.material.depthTest = settings.depthTest;
1198
+ }
1199
+ }
1200
+ });
1201
+ }
1172
1202
  };
1173
1203
  // Viseme jaw amounts
1174
1204
  __publicField(_LoomLargeThree, "VISEME_JAW_AMOUNTS", [