|
@@ -962,7 +962,6 @@ THREE.GLTFExporter.prototype = {
|
|
|
*
|
|
|
* Status:
|
|
|
* - Only properties listed in PATH_PROPERTIES may be animated.
|
|
|
- * - Only LINEAR and STEP interpolation currently supported.
|
|
|
*
|
|
|
* @param {THREE.AnimationClip} clip
|
|
|
* @param {THREE.Object3D} root
|
|
@@ -1016,11 +1015,37 @@ THREE.GLTFExporter.prototype = {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ var interpolation;
|
|
|
+
|
|
|
+ // @TODO export CubicInterpolant(InterpolateSmooth) as CUBICSPLINE
|
|
|
+
|
|
|
+ // Detecting glTF cubic spline interpolant by checking factory method's special property
|
|
|
+ // GLTFCubicSplineInterpolant is a custom interpolant and track doesn't return
|
|
|
+ // valid value from .getInterpolation().
|
|
|
+ if ( track.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline === true ) {
|
|
|
+
|
|
|
+ interpolation = 'CUBICSPLINE';
|
|
|
+
|
|
|
+ // itemSize of CUBICSPLINE keyframe is 9
|
|
|
+ // (VEC3 * 3: inTangent, splineVertex, and outTangent)
|
|
|
+ // but needs to be stored as VEC3 so dividing by 3 here.
|
|
|
+ outputItemSize /= 3;
|
|
|
+
|
|
|
+ } else if ( track.getInterpolation() === THREE.InterpolateDiscrete ) {
|
|
|
+
|
|
|
+ interpolation = 'STEP';
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ interpolation = 'LINEAR';
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
samplers.push( {
|
|
|
|
|
|
input: processAccessor( new THREE.BufferAttribute( track.times, inputItemSize ) ),
|
|
|
output: processAccessor( new THREE.BufferAttribute( track.values, outputItemSize ) ),
|
|
|
- interpolation: track.getInterpolation() === THREE.InterpolateDiscrete ? 'STEP' : 'LINEAR'
|
|
|
+ interpolation: interpolation
|
|
|
|
|
|
} );
|
|
|
|