@xviewer.js/core 1.0.0-alpha.42 → 1.0.0-alpha.44

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/module.js CHANGED
@@ -1063,22 +1063,24 @@ class aLoader {
1063
1063
  if (object.isMesh) {
1064
1064
  meshes.push(object);
1065
1065
  const mat = object.material;
1066
- if (Array.isArray(mat)) mat.forEach((v)=>materials[v.name] = v);
1067
- else materials[mat.name] = mat;
1068
- keys.forEach((k)=>{
1069
- let tex = mat[k];
1070
- if (tex) {
1071
- textures[tex.uuid] = tex;
1072
- }
1073
- });
1066
+ if (Array.isArray(mat)) mat.forEach((v)=>materials[v.uuid] = v);
1067
+ else materials[mat.uuid] = mat;
1074
1068
  }
1075
- object.children.forEach((v)=>queue.push(v));
1069
+ queue.push(...object.children);
1076
1070
  }
1077
- node.userData.meshData = {
1071
+ Object.values(materials).forEach((mat)=>{
1072
+ keys.forEach((k)=>{
1073
+ let tex = mat[k];
1074
+ if (tex) {
1075
+ textures[tex.uuid] = tex;
1076
+ }
1077
+ });
1078
+ });
1079
+ Object.assign(node.userData, {
1078
1080
  meshes,
1079
1081
  materials,
1080
1082
  textures
1081
- };
1083
+ });
1082
1084
  return node;
1083
1085
  }
1084
1086
  constructor(manager){
@@ -1086,6 +1088,7 @@ class aLoader {
1086
1088
  }
1087
1089
  }
1088
1090
  aLoader._texKeys = [
1091
+ "map",
1089
1092
  "alphaMap",
1090
1093
  "aoMap",
1091
1094
  "bumpMap",
@@ -1096,7 +1099,8 @@ aLoader._texKeys = [
1096
1099
  "metalnessMap",
1097
1100
  "normalMap",
1098
1101
  "roughnessMap",
1099
- "specularMap"
1102
+ "specularMap",
1103
+ "alphaMap"
1100
1104
  ];
1101
1105
 
1102
1106
  class aEXRLoader extends aLoader {