Sfoglia il codice sorgente

Animation: Remove automatic track validate/optimize.

Don McCurdy 7 anni fa
parent
commit
f3190aab55

+ 2 - 3
docs/api/animation/AnimationClip.html

@@ -69,7 +69,7 @@
 		<h3>[method:this optimize]()</h3>
 		<h3>[method:this optimize]()</h3>
 		<p>
 		<p>
 			Optimizes each track by removing equivalent sequential keys (which are common in morph target
 			Optimizes each track by removing equivalent sequential keys (which are common in morph target
-			sequences). Called automatically by [page:AnimationMixer.clipAction mixer.clipAction]().
+			sequences).
 		</p>
 		</p>
 
 
 		<h3>[method:this resetDuration]()</h3>
 		<h3>[method:this resetDuration]()</h3>
@@ -85,8 +85,7 @@
 
 
 		<h3>[method:Boolean validate]()</h3>
 		<h3>[method:Boolean validate]()</h3>
 		<p>
 		<p>
-			Performs minimal validation on each track in the clip. Called automatically by
-			[page:AnimationMixer.clipAction mixer.clipAction](). Returns true if all tracks are valid.
+			Performs minimal validation on each track in the clip. Returns true if all tracks are valid.
 		</p>
 		</p>
 
 
 
 

+ 1 - 4
docs/api/animation/AnimationMixer.html

@@ -49,15 +49,12 @@
 		<h2>Methods</h2>
 		<h2>Methods</h2>
 
 
 
 
-		<h3>[method:AnimationAction clipAction]([param:AnimationClip clip], [param:Object3D optionalRoot], [param:Boolean needsValidateAndOptimize])</h3>
+		<h3>[method:AnimationAction clipAction]([param:AnimationClip clip], [param:Object3D optionalRoot])</h3>
 		<p>
 		<p>
 			Returns an [page:AnimationAction] for the passed clip, optionally using a root object different
 			Returns an [page:AnimationAction] for the passed clip, optionally using a root object different
 			from the mixer's default root. The first parameter can be either an [page:AnimationClip] object
 			from the mixer's default root. The first parameter can be either an [page:AnimationClip] object
 			or the name of an AnimationClip.<br /><br />
 			or the name of an AnimationClip.<br /><br />
 
 
-			Automatically calls .validate() and .optimize() on the clip, unless 'needsValidateAndOptimize'
-			parameter is set to false.<br /><br />
-
 			If an action fitting the clip and root parameters doesn't yet exist, it will be created by
 			If an action fitting the clip and root parameters doesn't yet exist, it will be created by
 			this method. Calling this method several times with the same clip and root parameters always
 			this method. Calling this method several times with the same clip and root parameters always
 			returns the same clip instance.
 			returns the same clip instance.

+ 1 - 3
docs/api/animation/KeyframeTrack.html

@@ -205,7 +205,6 @@
 		<h3>[method:this optimize]()</h3>
 		<h3>[method:this optimize]()</h3>
 		<p>
 		<p>
 			Removes equivalent sequential keys, which are common in morph target sequences.
 			Removes equivalent sequential keys, which are common in morph target sequences.
-			Called automatically by [page:AnimationMixer.clipAction mixer.clipAction]().
 		</p>
 		</p>
 
 
 		<h3>[method:this scale]()</h3>
 		<h3>[method:this scale]()</h3>
@@ -236,8 +235,7 @@
 
 
 		<h3>[method:Boolean validate]()</h3>
 		<h3>[method:Boolean validate]()</h3>
 		<p>
 		<p>
-			Performs minimal validation on the tracks. Called automatically by
-			[page:AnimationMixer.clipAction mixer.clipAction](). Returns true if valid.
+			Performs minimal validation on the tracks. Returns true if valid.
 		</p>
 		</p>
 
 
 		<p>
 		<p>

+ 1 - 7
src/animation/AnimationMixer.js

@@ -518,7 +518,7 @@ AnimationMixer.prototype = Object.assign( Object.create( EventDispatcher.prototy
 	// return an action for a clip optionally using a custom root target
 	// return an action for a clip optionally using a custom root target
 	// object (this method allocates a lot of dynamic memory in case a
 	// object (this method allocates a lot of dynamic memory in case a
 	// previously unknown clip/root combination is specified)
 	// previously unknown clip/root combination is specified)
-	clipAction: function ( clip, optionalRoot, needsValidateAndOptimize ) {
+	clipAction: function ( clip, optionalRoot ) {
 
 
 		var root = optionalRoot || this._root,
 		var root = optionalRoot || this._root,
 			rootUuid = root.uuid,
 			rootUuid = root.uuid,
@@ -555,12 +555,6 @@ AnimationMixer.prototype = Object.assign( Object.create( EventDispatcher.prototy
 		// clip must be known when specified via string
 		// clip must be known when specified via string
 		if ( clipObject === null ) return null;
 		if ( clipObject === null ) return null;
 
 
-		if ( needsValidateAndOptimize !== false ) {
-
-			if ( clipObject.validate() ) clipObject.optimize();
-
-		}
-
 		// allocate all resources required to run it
 		// allocate all resources required to run it
 		var newAction = new AnimationAction( this, clipObject, optionalRoot );
 		var newAction = new AnimationAction( this, clipObject, optionalRoot );
 
 

+ 0 - 26
src/animation/KeyframeTrack.js

@@ -34,12 +34,6 @@ function KeyframeTrack( name, times, values, interpolation ) {
 	this.times = AnimationUtils.convertArray( times, this.TimeBufferType );
 	this.times = AnimationUtils.convertArray( times, this.TimeBufferType );
 	this.values = AnimationUtils.convertArray( values, this.ValueBufferType );
 	this.values = AnimationUtils.convertArray( values, this.ValueBufferType );
 
 
-	// TODO: These flags are used to warn users of duplicate validate/optimize
-	// calls when multiple actions are created from a single clip, starting with
-	// r95. We will eventually remove these flags and the transitional warnings.
-	this._needsValidate = true;
-	this._needsOptimize = true;
-
 	this.setInterpolation( interpolation || this.DefaultInterpolation );
 	this.setInterpolation( interpolation || this.DefaultInterpolation );
 
 
 }
 }
@@ -358,14 +352,6 @@ Object.assign( KeyframeTrack.prototype, {
 	// ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable
 	// ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable
 	validate: function () {
 	validate: function () {
 
 
-		if ( ! this._needsValidate ) {
-
-			console.warn( 'THREE.KeyframeTrack: Track has already been validated. '
-				+ 'Disable "needsValidateAndOptimize" argument to mixer.clipAction() '
-				+ 'to avoid redundant validation.' );
-
-		}
-
 		var valid = true;
 		var valid = true;
 
 
 		var valueSize = this.getValueSize();
 		var valueSize = this.getValueSize();
@@ -436,8 +422,6 @@ Object.assign( KeyframeTrack.prototype, {
 
 
 		}
 		}
 
 
-		this._needsValidate = !valid;
-
 		return valid;
 		return valid;
 
 
 	},
 	},
@@ -446,14 +430,6 @@ Object.assign( KeyframeTrack.prototype, {
 	// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)
 	// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)
 	optimize: function () {
 	optimize: function () {
 
 
-		if ( ! this._needsOptimize ) {
-
-			console.warn( 'THREE.KeyframeTrack: Track has already been optimized. '
-				+ 'Disable "needsValidateAndOptimize" argument to mixer.clipAction() '
-				+ 'to avoid redundant optimization.' );
-
-		}
-
 		var times = this.times,
 		var times = this.times,
 			values = this.values,
 			values = this.values,
 			stride = this.getValueSize(),
 			stride = this.getValueSize(),
@@ -552,8 +528,6 @@ Object.assign( KeyframeTrack.prototype, {
 
 
 		}
 		}
 
 
-		this._needsOptimize = false;
-
 		return this;
 		return this;
 
 
 	}
 	}