Skip to content

Commit ce2dd7c

Browse files
tschwmrdoob
authored andcommitted
AnimationClip: Let morph parsers take 'noLoop'.
- See mrdoob#8446
1 parent b836a01 commit ce2dd7c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/animation/AnimationClip.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Object.assign( THREE.AnimationClip, {
119119
},
120120

121121

122-
CreateFromMorphTargetSequence: function( name, morphTargetSequence, fps ) {
122+
CreateFromMorphTargetSequence: function( name, morphTargetSequence, fps, noLoop ) {
123123

124124
var numMorphTargets = morphTargetSequence.length;
125125
var tracks = [];
@@ -142,7 +142,7 @@ Object.assign( THREE.AnimationClip, {
142142

143143
// if there is a key at the first frame, duplicate it as the
144144
// last frame as well for perfect loop.
145-
if ( times[ 0 ] === 0 ) {
145+
if ( ! noLoop && times[ 0 ] === 0 ) {
146146

147147
times.push( numMorphTargets );
148148
values.push( values[ 0 ] );
@@ -175,7 +175,7 @@ Object.assign( THREE.AnimationClip, {
175175

176176
},
177177

178-
CreateClipsFromMorphTargetSequences: function( morphTargets, fps ) {
178+
CreateClipsFromMorphTargetSequences: function( morphTargets, fps, noLoop ) {
179179

180180
var animationToMorphTargets = {};
181181

@@ -211,7 +211,7 @@ Object.assign( THREE.AnimationClip, {
211211

212212
for ( var name in animationToMorphTargets ) {
213213

214-
clips.push( THREE.AnimationClip.CreateFromMorphTargetSequence( name, animationToMorphTargets[ name ], fps ) );
214+
clips.push( THREE.AnimationClip.CreateFromMorphTargetSequence( name, animationToMorphTargets[ name ], fps, noLoop ) );
215215

216216
}
217217

0 commit comments

Comments
 (0)