From 0c4e410a27ea2df8336a956e966ee16ad8ac04d7 Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Mon, 18 Dec 2017 10:09:09 +0100 Subject: [PATCH] fix material index --- src/utils/exportUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/exportUtils.js b/src/utils/exportUtils.js index c196d6d..3f8e006 100644 --- a/src/utils/exportUtils.js +++ b/src/utils/exportUtils.js @@ -98,11 +98,11 @@ export function generateExportMesh(state, options = {}) { objectGeometry.mergeVertices(); objectGeometry.applyMatrix(new THREE.Matrix4().multiplyMatrices(objectMatrix, matrix)); + const materialIndex = materials.length; const exportMaterial = new THREE.MeshBasicMaterial({ color: material.color.getHex() }); exportMaterial.side = shapeData.fill ? THREE.FrontSide : THREE.DoubleSide; materials.push(exportMaterial); - const materialIndex = materials.length; if (unionGeometry) { objectGeometry = new THREE_BSP(objectGeometry, materialIndex); if (exportGeometry) {