Skip to content

Commit

Permalink
geometry/object.clips -> geometry/object.animation
Browse files Browse the repository at this point in the history
  • Loading branch information
bhouston committed Sep 17, 2015
1 parent e773d4e commit 33eb489
Show file tree
Hide file tree
Showing 39 changed files with 2,824 additions and 2,887 deletions.
18 changes: 9 additions & 9 deletions examples/js/BlendCharacter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

THREE.BlendCharacter = function () {

this.clips = {};
this.animations = {};
this.weightSchedule = [];
this.warpSchedule = [];

Expand All @@ -23,10 +23,10 @@ THREE.BlendCharacter = function () {
scope.mixer = new THREE.AnimationMixer( scope );

// Create the animations
for ( var i = 0; i < geometry.clips.length; ++ i ) {
for ( var i = 0; i < geometry.animations.length; ++ i ) {

var animName = geometry.clips[ i ].name;
scope.clips[ animName ] = geometry.clips[ i ];
var animName = geometry.animations[ i ].name;
scope.animations[ animName ] = geometry.animations[ i ];

}

Expand All @@ -47,16 +47,16 @@ THREE.BlendCharacter = function () {

this.mixer.removeAllActions();

this.mixer.play( new THREE.AnimationAction( this.clips[ animName ] ) );
this.mixer.play( new THREE.AnimationAction( this.animations[ animName ] ) );

};

this.crossfade = function( fromAnimName, toAnimName, duration ) {

this.mixer.removeAllActions();

var fromAction = new THREE.AnimationAction( this.clips[ fromAnimName ] );
var toAction = new THREE.AnimationAction( this.clips[ toAnimName ] );
var fromAction = new THREE.AnimationAction( this.animations[ fromAnimName ] );
var toAction = new THREE.AnimationAction( this.animations[ toAnimName ] );

this.mixer.play( fromAction );
this.mixer.play( toAction );
Expand All @@ -69,8 +69,8 @@ THREE.BlendCharacter = function () {

this.mixer.removeAllActions();

var fromAction = new THREE.AnimationAction( this.clips[ fromAnimName ] );
var toAction = new THREE.AnimationAction( this.clips[ toAnimName ] );
var fromAction = new THREE.AnimationAction( this.animations[ fromAnimName ] );
var toAction = new THREE.AnimationAction( this.animations[ toAnimName ] );

this.mixer.play( fromAction );
this.mixer.play( toAction );
Expand Down
6 changes: 3 additions & 3 deletions examples/js/MD2Character.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ THREE.MD2Character = function () {
scope.meshBody = mesh;

scope.meshBody.clipOffset = 0;
scope.activeAnimationClipName = mesh.geometry.clips[0].name;
scope.activeAnimationClipName = mesh.geometry.animations[0].name;

scope.mixer = new THREE.AnimationMixer( mesh );

Expand Down Expand Up @@ -158,7 +158,7 @@ THREE.MD2Character = function () {
this.meshBody.activeAction = null;
}

var clip = THREE.AnimationClip.findByName( this.meshBody.geometry.clips, clipName );
var clip = THREE.AnimationClip.findByName( this.meshBody.geometry.animations, clipName );
if( clip ) {

var action = new THREE.AnimationAction( clip, this.mixer.time ).setLocalRoot( this.meshBody );
Expand Down Expand Up @@ -187,7 +187,7 @@ THREE.MD2Character = function () {
this.meshWeapon.activeAction = null;
}

var clip = THREE.AnimationClip.findByName( this.meshWeapon.geometry.clips, clipName );
var clip = THREE.AnimationClip.findByName( this.meshWeapon.geometry.animations, clipName );
if( clip ) {

var action = new THREE.AnimationAction( clip ).syncWith( this.meshBody.activeAction ).setLocalRoot( this.meshWeapon );
Expand Down
4 changes: 2 additions & 2 deletions examples/js/MorphAnimMesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ THREE.MorphAnimMesh.prototype.playAnimation = function ( label, fps ) {

}

var clip = THREE.AnimationClip.findByName( this.geometry.clips, label );
var clip = THREE.AnimationClip.findByName( this.geometry.animations, label );

if ( clip ) {

Expand All @@ -47,7 +47,7 @@ THREE.MorphAnimMesh.prototype.playAnimation = function ( label, fps ) {

} else {

throw new Error( 'THREE.MorphAnimMesh: clips[' + label + '] undefined in .playAnimation()' );
throw new Error( 'THREE.MorphAnimMesh: animations[' + label + '] undefined in .playAnimation()' );

}

Expand Down
2 changes: 1 addition & 1 deletion examples/js/UCSCharacter.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ THREE.UCSCharacter = function() {
mesh.castShadow = true;
mesh.receiveShadow = true;

scope.mixer.addAction( new THREE.AnimationAction( geometry.clips[0] ).setLocalRoot( mesh ) );
scope.mixer.addAction( new THREE.AnimationAction( geometry.animations[0] ).setLocalRoot( mesh ) );

scope.setSkin( 0 );

Expand Down
2 changes: 1 addition & 1 deletion examples/js/loaders/MD2Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ THREE.MD2Loader.prototype = {

}

geometry.clips = THREE.AnimationClip.CreateClipsFromMorphTargetSequences( geometry.morphTargets, 10 )
geometry.animations = THREE.AnimationClip.CreateClipsFromMorphTargetSequences( geometry.morphTargets, 10 )

console.timeEnd( 'MD2Loader' );

Expand Down
Loading

0 comments on commit 33eb489

Please sign in to comment.