Skip to content

Commit 0c4e410

Browse files
committed
fix material index
1 parent 01f4b4c commit 0c4e410

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/exportUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ export function generateExportMesh(state, options = {}) {
9898
objectGeometry.mergeVertices();
9999
objectGeometry.applyMatrix(new THREE.Matrix4().multiplyMatrices(objectMatrix, matrix));
100100

101+
const materialIndex = materials.length;
101102
const exportMaterial = new THREE.MeshBasicMaterial({ color: material.color.getHex() });
102103
exportMaterial.side = shapeData.fill ? THREE.FrontSide : THREE.DoubleSide;
103104
materials.push(exportMaterial);
104105

105-
const materialIndex = materials.length;
106106
if (unionGeometry) {
107107
objectGeometry = new THREE_BSP(objectGeometry, materialIndex);
108108
if (exportGeometry) {

0 commit comments

Comments
 (0)