|
@@ -813,14 +813,14 @@ export class OBJFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlugi
|
|
|
|
|
|
//If this new material is in the same mesh
|
|
//If this new material is in the same mesh
|
|
|
|
|
|
- if (!isFirstMaterial) {
|
|
|
|
|
|
+ if (!isFirstMaterial || !hasMeshes) {
|
|
//Set the data for the previous mesh
|
|
//Set the data for the previous mesh
|
|
addPreviousObjMesh();
|
|
addPreviousObjMesh();
|
|
//Create a new mesh
|
|
//Create a new mesh
|
|
var objMesh: MeshObject =
|
|
var objMesh: MeshObject =
|
|
//Set the name of the current obj mesh
|
|
//Set the name of the current obj mesh
|
|
{
|
|
{
|
|
- name: objMeshName + "_mm" + increment.toString(), //Set the name of the current obj mesh
|
|
|
|
|
|
+ name: (objMeshName || "mesh") + "_mm" + increment.toString(), //Set the name of the current obj mesh
|
|
indices: undefined,
|
|
indices: undefined,
|
|
positions: undefined,
|
|
positions: undefined,
|
|
normals: undefined,
|
|
normals: undefined,
|
|
@@ -831,6 +831,7 @@ export class OBJFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPlugi
|
|
increment++;
|
|
increment++;
|
|
//If meshes are already defined
|
|
//If meshes are already defined
|
|
meshesFromObj.push(objMesh);
|
|
meshesFromObj.push(objMesh);
|
|
|
|
+ hasMeshes = true;
|
|
}
|
|
}
|
|
//Set the material name if the previous line define a mesh
|
|
//Set the material name if the previous line define a mesh
|
|
|
|
|