Skip to content

Commit

Permalink
AnimationClip: default constructor parameters (#27956)
Browse files Browse the repository at this point in the history
This makes AnimationClip easier to use without providing initial tracks, f.e.

```js
const clip = new AnimationClip();

// ...any time later...
clip.tracks.push(...keyframeTracks)
clip.resetDuration()
```
  • Loading branch information
trusktr authored Mar 21, 2024
1 parent 43fbcef commit d769526
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/animation/AnimationClip.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { NormalAnimationBlendMode } from '../constants.js';

class AnimationClip {

constructor( name, duration = - 1, tracks, blendMode = NormalAnimationBlendMode ) {
constructor( name = '', duration = - 1, tracks = [], blendMode = NormalAnimationBlendMode ) {

this.name = name;
this.tracks = tracks;
Expand Down

0 comments on commit d769526

Please sign in to comment.