Browse Source

more bug fixing.

Ben Houston 10 years ago
parent
commit
b396969063

+ 2 - 2
examples/webgl_animation_track_clip_mixer.html

@@ -308,14 +308,14 @@
 
 				// update skinning
 
-				THREE.AnimationHandler.update( delta );
+				//THREE.AnimationHandler.update( delta );
 
 				if( mixer ) {
 					time1 += delta;
 					mixer.update( time1 );
 				}
 				
-				if ( helper !== undefined ) helper.update();
+				//if ( helper !== undefined ) helper.update();
 
 				// update morphs
 

+ 0 - 1
src/animation/AnimationAction.js

@@ -15,7 +15,6 @@ THREE.AnimationAction = function ( clip, startTime, timeScale, weight, loop ) {
 	this.loop = loop || clip.loop || false;
 	this.enabled = true;	// allow for easy disabling of the action.
 
-	this.cache = {}; // track name, track, last evaluated time, last evaluated value (with weight included), keyIndex.
 };
 
 THREE.AnimationAction.prototype = {

+ 3 - 1
src/animation/AnimationMixer.js

@@ -25,8 +25,10 @@ THREE.AnimationMixer.prototype = {
 
 		this.actions.push( action );
 
-		for( var track in action.tracks ) {
 
+		for( var trackID in action.clip.tracks ) {
+
+			var track = action.clip.tracks[ trackID ];
 			if( ! this.propertyBindings[ track.name ] ) {
 			
 				this.propertyBindings[ track.name ] = new THREE.PropertyBinding( this.root, track.name );

+ 6 - 6
src/animation/PropertyBinding.js

@@ -39,7 +39,7 @@ THREE.PropertyBinding.prototype = {
  		// ensure there is a value property on the node
 		var nodeProperty = this.node[ this.propertyName ];
 		if( ! nodeProperty ) {
-			console.log( "  trying to update property for track: " + this.nodeName + '.' + this.propertyName + " but it wasn't found." );				
+			console.log( "  trying to update property for track: " + this.nodeName + '.' + this.propertyName + " but it wasn't found.", this );				
 			return;
 		}
 
@@ -60,11 +60,11 @@ THREE.PropertyBinding.prototype = {
 		}
 
 		// trigger node dirty			
-		if( this.node.needsUpdate ) { // material
+		if( this.node.needsUpdate !== undefined ) { // material
 			console.log( '  triggering material as dirty' );
 			this.node.needsUpdate = true;
 		}			
-		if( this.node.matrixWorldNeedsUpdate && ! this.node.matrixAutoUpdate ) { // node transform
+		if( this.node.matrixWorldNeedsUpdate !== undefined ) { // node transform
 			console.log( '  triggering node as dirty' );
 			this.node.matrixWorldNeedsUpdate = true;
 		}
@@ -103,9 +103,9 @@ THREE.PropertyBinding.parseTrackName = function( trackName ) {
 
 	var results = {
 		directoryName: matches[0],
-		nodeName: matches[2], 	// allowed to be null, specified root node.
-		propertyName: matches[4],
-		propertySubElement: matches[6]	// allowed to be null, specifies that the whole property is set.
+		nodeName: matches[3], 	// allowed to be null, specified root node.
+		propertyName: matches[5],
+		propertySubElement: matches[7]	// allowed to be null, specifies that the whole property is set.
 	};
 
 	console.log( "PropertyBinding.parseTrackName", trackName, results, matches );