Browse Source

Merge pull request #12487 from looeee/FBXLoader_check_translate_scale_params_defined_per_frame

FBXLoader check position and scale axis is defined per frame
Mr.doob 7 years ago
parent
commit
7b9118d31d
1 changed files with 34 additions and 2 deletions
  1. 34 2
      examples/js/loaders/FBXLoader.js

+ 34 - 2
examples/js/loaders/FBXLoader.js

@@ -2744,7 +2744,23 @@
 
 
 			if ( hasCurve( animationNode, 'T' ) && hasKeyOnFrame( animationNode.T, frame ) ) {
 			if ( hasCurve( animationNode, 'T' ) && hasKeyOnFrame( animationNode.T, frame ) ) {
 
 
-				key.pos = [ animationNode.T.curves.x.values[ frame ], animationNode.T.curves.y.values[ frame ], animationNode.T.curves.z.values[ frame ] ];
+				if ( animationNode.T.curves.x.values[ frame ] ) {
+
+					key.pos[ 0 ] = animationNode.T.curves.x.values[ frame ];
+
+				}
+
+				if ( animationNode.T.curves.y.values[ frame ] ) {
+
+					key.pos[ 1 ] = animationNode.T.curves.y.values[ frame ];
+
+				}
+
+				if ( animationNode.T.curves.z.values[ frame ] ) {
+
+					key.pos[ 2 ] = animationNode.T.curves.z.values[ frame ];
+
+				}
 
 
 			}
 			}
 
 
@@ -2776,7 +2792,23 @@
 
 
 			if ( hasCurve( animationNode, 'S' ) && hasKeyOnFrame( animationNode.S, frame ) ) {
 			if ( hasCurve( animationNode, 'S' ) && hasKeyOnFrame( animationNode.S, frame ) ) {
 
 
-				key.scl = [ animationNode.S.curves.x.values[ frame ], animationNode.S.curves.y.values[ frame ], animationNode.S.curves.z.values[ frame ] ];
+				if ( animationNode.T.curves.x.values[ frame ] ) {
+
+					key.scl[ 0 ] = animationNode.S.curves.x.values[ frame ];
+
+				}
+
+				if ( animationNode.T.curves.y.values[ frame ] ) {
+
+					key.scl[ 1 ] = animationNode.S.curves.y.values[ frame ];
+
+				}
+
+				if ( animationNode.T.curves.z.values[ frame ] ) {
+
+					key.scl[ 2 ] = animationNode.S.curves.z.values[ frame ];
+
+				}
 
 
 			}
 			}