未验证 提交 a2cc721f 编写于 作者: M Michael Herzog 提交者: GitHub

Merge pull request #20763 from Mugen87/dev41

OBJLoader: Only add color attribute if necessary.
......@@ -875,7 +875,7 @@ THREE.OBJLoader = ( function () {
buffergeometry.setAttribute( 'position', new THREE.Float32BufferAttribute( state.vertices, 3 ) );
if ( state.colors.length > 0 ) {
if ( state.colors.length > 0 && state.colors[ 0 ] !== undefined ) {
buffergeometry.setAttribute( 'color', new THREE.Float32BufferAttribute( state.colors, 3 ) );
material.vertexColors = true;
......
......@@ -891,7 +891,7 @@ var OBJLoader = ( function () {
buffergeometry.setAttribute( 'position', new Float32BufferAttribute( state.vertices, 3 ) );
if ( state.colors.length > 0 ) {
if ( state.colors.length > 0 && state.colors[ 0 ] !== undefined ) {
buffergeometry.setAttribute( 'color', new Float32BufferAttribute( state.colors, 3 ) );
material.vertexColors = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册