提交 3a708357 编写于 作者: M Mugen87

GLTFExporter: Fix multi material export

上级 5f1abcc5
......@@ -1206,7 +1206,7 @@ THREE.GLTFExporter.prototype = {
var forceIndices = options.forceIndices;
var isMultiMaterial = Array.isArray( mesh.material );
if ( isMultiMaterial && mesh.geometry.groups.length === 0 ) return null;
if ( isMultiMaterial && geometry.groups.length === 0 ) return null;
if ( ! forceIndices && geometry.index === null && isMultiMaterial ) {
......@@ -1235,7 +1235,7 @@ THREE.GLTFExporter.prototype = {
}
var materials = isMultiMaterial ? mesh.material : [ mesh.material ];
var groups = isMultiMaterial ? mesh.geometry.groups : [ { materialIndex: 0, start: undefined, count: undefined } ];
var groups = isMultiMaterial ? geometry.groups : [ { materialIndex: 0, start: undefined, count: undefined } ];
for ( var i = 0, il = groups.length; i < il; i ++ ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册