From 74bc5243fd33a90c20624272502fff15b29a313f Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Sun, 8 Nov 2020 22:46:06 +0100 Subject: [PATCH] Fix #761 - Gltf export doesn't do anything --- lib/GLTFExporter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/GLTFExporter.js b/lib/GLTFExporter.js index 8f969a6..48966a3 100644 --- a/lib/GLTFExporter.js +++ b/lib/GLTFExporter.js @@ -1292,7 +1292,9 @@ GLTFExporter.prototype = { modifiedAttribute.array.forEach((v, i) => { if (isCube) { - var map = mesh.material[Math.floor(i / 12)].map; + var map = mesh.material instanceof Array + ? mesh.material[Math.floor(i / 12)].map + : mesh.material.map; } if (map && map.image) { if (i%2 == 0) {