loomlarge 0.1.6 → 0.2.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.
package/dist/index.cjs CHANGED
@@ -719,6 +719,7 @@ var _LoomLargeThree = class _LoomLargeThree {
719
719
  this.rigReady = true;
720
720
  this.missingBoneWarnings.clear();
721
721
  this.initBoneRotations();
722
+ this.applyMeshMaterialSettings(model);
722
723
  }
723
724
  update(deltaSeconds) {
724
725
  const dtSeconds = Math.max(0, deltaSeconds || 0);
@@ -1173,6 +1174,35 @@ var _LoomLargeThree = class _LoomLargeThree {
1173
1174
  cancel: () => handles.forEach((h) => h.cancel())
1174
1175
  };
1175
1176
  }
1177
+ /**
1178
+ * Apply render order and material settings from CC4_MESHES to all meshes.
1179
+ * This ensures proper layering (e.g., hair renders on top of eyebrows).
1180
+ */
1181
+ applyMeshMaterialSettings(root) {
1182
+ root.traverse((obj) => {
1183
+ if (!obj.isMesh || !obj.name) return;
1184
+ const meshInfo = CC4_MESHES[obj.name];
1185
+ if (!meshInfo?.material) return;
1186
+ const settings = meshInfo.material;
1187
+ if (typeof settings.renderOrder === "number") {
1188
+ obj.renderOrder = settings.renderOrder;
1189
+ }
1190
+ if (obj.material) {
1191
+ if (typeof settings.transparent === "boolean") {
1192
+ obj.material.transparent = settings.transparent;
1193
+ }
1194
+ if (typeof settings.opacity === "number") {
1195
+ obj.material.opacity = settings.opacity;
1196
+ }
1197
+ if (typeof settings.depthWrite === "boolean") {
1198
+ obj.material.depthWrite = settings.depthWrite;
1199
+ }
1200
+ if (typeof settings.depthTest === "boolean") {
1201
+ obj.material.depthTest = settings.depthTest;
1202
+ }
1203
+ }
1204
+ });
1205
+ }
1176
1206
  };
1177
1207
  // Viseme jaw amounts
1178
1208
  __publicField(_LoomLargeThree, "VISEME_JAW_AMOUNTS", [