提交 7139fe91 编写于 作者: T Takahiro

Set morph BufferAttribute name instead of pushing name to morphTargets

上级 2fe00b2d
......@@ -2158,15 +2158,13 @@ THREE.GLTF2Loader = ( function () {
if ( primitive.targets !== undefined ) {
geometry.morphTargets = [];
var targets = primitive.targets;
var morphAttributes = geometry.morphAttributes;
for ( var i = 0, il = targets.length; i < il; i ++ ) {
var target = targets[ i ];
geometry.morphTargets.push( { name: 'morphTarget' + i } );
var attributeName = 'morphTarget' + i;
if ( target.POSITION !== undefined ) {
......@@ -2189,6 +2187,7 @@ THREE.GLTF2Loader = ( function () {
// for the case if attribute is shared among two or more meshes.
var attribute = dependencies.accessors[ target.POSITION ].clone();
attribute.name = attributeName;
var position = geometry.attributes.position;
for ( var j = 0, jl = attribute.array.length; j < jl; j ++ ) {
......@@ -2210,6 +2209,7 @@ THREE.GLTF2Loader = ( function () {
// see target.POSITION's comment
var attribute = dependencies.accessors[ target.NORMAL ].clone();
attribute.name = attributeName;
var normal = geometry.attributes.normal;
for ( var j = 0, jl = attribute.array.length; j < jl; j ++ ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册