提交 b1afd197 编写于 作者: D Don McCurdy

Move .vertexColors assignment to apply to lines scope, as well.

上级 ce190ebd
......@@ -1696,11 +1696,13 @@ THREE.GLTF2Loader = ( function () {
var material = primitive.material !== undefined ? dependencies.materials[ primitive.material ] : createDefaultMaterial();
var geometry;
var meshNode;
if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLES || primitive.mode === undefined ) {
var geometry = new THREE.BufferGeometry();
geometry = new THREE.BufferGeometry();
var attributes = primitive.attributes;
......@@ -1750,12 +1752,6 @@ THREE.GLTF2Loader = ( function () {
}
if ( geometry.attributes.color !== undefined ) {
material.vertexColors = THREE.VertexColors;
}
if ( primitive.indices !== undefined ) {
geometry.setIndex( dependencies.accessors[ primitive.indices ] );
......@@ -1767,7 +1763,7 @@ THREE.GLTF2Loader = ( function () {
} else if ( primitive.mode === WEBGL_CONSTANTS.LINES ) {
var geometry = new THREE.BufferGeometry();
geometry = new THREE.BufferGeometry();
var attributes = primitive.attributes;
......@@ -1813,6 +1809,13 @@ THREE.GLTF2Loader = ( function () {
}
if ( geometry.attributes.color !== undefined ) {
material.vertexColors = THREE.VertexColors;
material.needsUpdate = true;
}
meshNode.name = ( name === "0" ? group.name : group.name + name );
if ( primitive.extras ) meshNode.userData = primitive.extras;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册