提交 ffaba6e3 编写于 作者: F Fernando Serrano

GLTFExporter: prevent exporting ShaderMaterial

上级 a3e8db4c
......@@ -387,9 +387,17 @@ THREE.GLTFExporter.prototype = {
}
if ( material instanceof THREE.ShaderMaterial ) {
console.warn( 'GLTFExporter: THREE.ShaderMaterial not supported.' );
return null;
}
if ( !( material instanceof THREE.MeshStandardMaterial ) ) {
console.warn( 'Currently just THREE.StandardMaterial is supported. Material conversion may lose information.' );
console.warn( 'GLTFExporter: Currently just THREE.StandardMaterial is supported. Material conversion may lose information.' );
}
......@@ -576,11 +584,18 @@ THREE.GLTFExporter.prototype = {
{
mode: mode,
attributes: {},
material: processMaterial( mesh.material )
}
]
};
var material = processMaterial( mesh.material );
if ( material ) {
gltfMesh.primitives[ 0 ].material = material;
}
if ( geometry.index ) {
gltfMesh.primitives[ 0 ].indices = processAccessor( geometry.index );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册