From 3ad988f56dffe80857e902f19917ea31832faedb Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Fri, 21 Dec 2018 11:15:17 +0100 Subject: [PATCH] Mesh: Remove Geometry support from .updateMorphTargets() --- src/objects/Mesh.js | 39 ++++++++++----------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/src/objects/Mesh.js b/src/objects/Mesh.js index f796876dfdcdc1..9e9ff78a583cf8 100644 --- a/src/objects/Mesh.js +++ b/src/objects/Mesh.js @@ -69,47 +69,28 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), { updateMorphTargets: function () { var geometry = this.geometry; - var m, ml, name; - if ( geometry.isBufferGeometry ) { + if ( geometry.isGeometry ) { - var morphAttributes = geometry.morphAttributes; - var keys = Object.keys( morphAttributes ); + console.error( 'THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.' ); - if ( keys.length > 0 ) { - - var morphAttribute = morphAttributes[ keys[ 0 ] ]; - - if ( morphAttribute !== undefined ) { - - this.morphTargetInfluences = []; - this.morphTargetDictionary = {}; - - for ( m = 0, ml = morphAttribute.length; m < ml; m ++ ) { - - name = morphAttribute[ m ].name || String( m ); - - this.morphTargetInfluences.push( 0 ); - this.morphTargetDictionary[ name ] = m; - - } - - } + } - } + var morphAttributes = geometry.morphAttributes; + var keys = Object.keys( morphAttributes ); - } else { + if ( keys.length > 0 ) { - var morphTargets = geometry.morphTargets; + var morphAttribute = morphAttributes[ keys[ 0 ] ]; - if ( morphTargets !== undefined && morphTargets.length > 0 ) { + if ( morphAttribute !== undefined ) { this.morphTargetInfluences = []; this.morphTargetDictionary = {}; - for ( m = 0, ml = morphTargets.length; m < ml; m ++ ) { + for ( var m = 0, ml = morphAttribute.length; m < ml; m ++ ) { - name = morphTargets[ m ].name || String( m ); + var name = morphAttribute[ m ].name || String( m ); this.morphTargetInfluences.push( 0 ); this.morphTargetDictionary[ name ] = m;