Skip to content

Commit

Permalink
Mesh: Remove Geometry support from .updateMorphTargets()
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Dec 21, 2018
1 parent 1f4dd25 commit 3ad988f
Showing 1 changed file with 10 additions and 29 deletions.
39 changes: 10 additions & 29 deletions src/objects/Mesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3ad988f

Please sign in to comment.