mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-01-18 15:26:19 +08:00
Fix error message with 0 faces
This commit is contained in:
parent
2d796348a6
commit
8a2df4501a
@ -458,8 +458,8 @@ const Canvas = {
|
||||
adaptObjectFaceGeo(cube) {
|
||||
let {mesh} = cube;
|
||||
let {geometry} = mesh;
|
||||
if (!mesh.geometry.all_faces) mesh.geometry.all_faces = mesh.geometry.faces.slice();
|
||||
mesh.geometry.faces.empty()
|
||||
if (!geometry.all_faces) geometry.all_faces = geometry.faces.slice();
|
||||
geometry.faces.empty()
|
||||
|
||||
geometry.all_faces.forEach(face => {
|
||||
let bb_face = cube.faces[Canvas.face_order[face.materialIndex]];
|
||||
@ -471,6 +471,10 @@ const Canvas = {
|
||||
geometry.faces.push(face);
|
||||
}
|
||||
})
|
||||
if (geometry.faces.length == 0) {
|
||||
// Keek down face if no faces enabled
|
||||
geometry.faces.push(geometry.all_faces[6], geometry.all_faces[7]);
|
||||
}
|
||||
geometry.elementsNeedUpdate = true;
|
||||
},
|
||||
ascendElementPosition(el, elmesh) {
|
||||
|
Loading…
Reference in New Issue
Block a user