|
@@ -56,17 +56,53 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
updateMorphTargets: function () {
|
|
|
|
|
|
- var morphTargets = this.geometry.morphTargets;
|
|
|
+ var geometry = this.geometry;
|
|
|
+ var m, ml, name;
|
|
|
|
|
|
- if ( morphTargets !== undefined && morphTargets.length > 0 ) {
|
|
|
+ if ( geometry.isBufferGeometry ) {
|
|
|
|
|
|
- this.morphTargetInfluences = [];
|
|
|
- this.morphTargetDictionary = {};
|
|
|
+ var morphAttributes = geometry.morphAttributes;
|
|
|
+ var keys = Object.keys( morphAttributes );
|
|
|
|
|
|
- for ( var m = 0, ml = morphTargets.length; m < ml; m ++ ) {
|
|
|
+ if ( keys.length > 0 ) {
|
|
|
|
|
|
- this.morphTargetInfluences.push( 0 );
|
|
|
- this.morphTargetDictionary[ morphTargets[ m ].name ] = m;
|
|
|
+ var morphAttribute = morphAttributes[ keys[ 0 ] ];
|
|
|
+
|
|
|
+ if ( morphAttribute !== undefined ) {
|
|
|
+
|
|
|
+ this.morphTargetInfluences = [];
|
|
|
+ this.morphTargetDictionary = {};
|
|
|
+
|
|
|
+ for ( m = 0, ml = morphAttribute.length; m < lm; m ++ ) {
|
|
|
+
|
|
|
+ name = morphAttribute[ m ].name || m;
|
|
|
+
|
|
|
+ this.morphTargetInfluences.push( 0 );
|
|
|
+ this.morphTargetDictionary[ name ] = m;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ var morphTargets = geometry.morphTargets;
|
|
|
+
|
|
|
+ if ( morphTargets !== undefined && morphTargets.length > 0 ) {
|
|
|
+
|
|
|
+ this.morphTargetInfluences = [];
|
|
|
+ this.morphTargetDictionary = {};
|
|
|
+
|
|
|
+ for ( m = 0, ml = morphTargets.length; m < ml; m ++ ) {
|
|
|
+
|
|
|
+ name = morphTargets[ m ].name || m;
|
|
|
+
|
|
|
+ this.morphTargetInfluences.push( 0 );
|
|
|
+ this.morphTargetDictionary[ name ] = m;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|