|
@@ -712,9 +712,9 @@ THREE.FBXLoader = ( function () {
|
|
ID: child.ID,
|
|
ID: child.ID,
|
|
indices: [],
|
|
indices: [],
|
|
weights: [],
|
|
weights: [],
|
|
- transform: new THREE.Matrix4().fromArray( boneNode.Transform.a ),
|
|
|
|
transformLink: new THREE.Matrix4().fromArray( boneNode.TransformLink.a ),
|
|
transformLink: new THREE.Matrix4().fromArray( boneNode.TransformLink.a ),
|
|
- linkMode: boneNode.Mode,
|
|
|
|
|
|
+ // transform: new THREE.Matrix4().fromArray( boneNode.Transform.a ),
|
|
|
|
+ // linkMode: boneNode.Mode,
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
@@ -873,7 +873,10 @@ THREE.FBXLoader = ( function () {
|
|
case 'NurbsCurve':
|
|
case 'NurbsCurve':
|
|
model = this.createCurve( relationships, geometryMap );
|
|
model = this.createCurve( relationships, geometryMap );
|
|
break;
|
|
break;
|
|
- case 'LimbNode': // usually associated with a Bone, however if a Bone was not created we'll make a Group instead
|
|
|
|
|
|
+ case 'LimbNode':
|
|
|
|
+ case 'Root':
|
|
|
|
+ model = new THREE.Bone();
|
|
|
|
+ break;
|
|
case 'Null':
|
|
case 'Null':
|
|
default:
|
|
default:
|
|
model = new THREE.Group();
|
|
model = new THREE.Group();
|
|
@@ -911,6 +914,7 @@ THREE.FBXLoader = ( function () {
|
|
|
|
|
|
var subBone = bone;
|
|
var subBone = bone;
|
|
bone = new THREE.Bone();
|
|
bone = new THREE.Bone();
|
|
|
|
+
|
|
bone.matrixWorld.copy( rawBone.transformLink );
|
|
bone.matrixWorld.copy( rawBone.transformLink );
|
|
|
|
|
|
// set name and id here - otherwise in cases where "subBone" is created it will not have a name / id
|
|
// set name and id here - otherwise in cases where "subBone" is created it will not have a name / id
|
|
@@ -2280,7 +2284,6 @@ THREE.FBXLoader = ( function () {
|
|
|
|
|
|
var animationClips = [];
|
|
var animationClips = [];
|
|
|
|
|
|
-
|
|
|
|
var rawClips = this.parseClips();
|
|
var rawClips = this.parseClips();
|
|
|
|
|
|
if ( rawClips === undefined ) return;
|
|
if ( rawClips === undefined ) return;
|
|
@@ -2460,12 +2463,15 @@ THREE.FBXLoader = ( function () {
|
|
if ( child.ID = rawModel.id ) {
|
|
if ( child.ID = rawModel.id ) {
|
|
|
|
|
|
node.transform = child.matrix;
|
|
node.transform = child.matrix;
|
|
|
|
+
|
|
if ( child.userData.transformData ) node.eulerOrder = child.userData.transformData.eulerOrder;
|
|
if ( child.userData.transformData ) node.eulerOrder = child.userData.transformData.eulerOrder;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
+ if ( ! node.transform ) node.transform = new THREE.Matrix4();
|
|
|
|
+
|
|
// if the animated model is pre rotated, we'll have to apply the pre rotations to every
|
|
// if the animated model is pre rotated, we'll have to apply the pre rotations to every
|
|
// animation value as well
|
|
// animation value as well
|
|
if ( 'PreRotation' in rawModel ) node.preRotation = rawModel.PreRotation.value;
|
|
if ( 'PreRotation' in rawModel ) node.preRotation = rawModel.PreRotation.value;
|
|
@@ -2585,7 +2591,7 @@ THREE.FBXLoader = ( function () {
|
|
var initialRotation = new THREE.Quaternion();
|
|
var initialRotation = new THREE.Quaternion();
|
|
var initialScale = new THREE.Vector3();
|
|
var initialScale = new THREE.Vector3();
|
|
|
|
|
|
- if ( rawTracks.transform ) rawTracks.transform.decompose( initialPosition, initialRotation, initialScale );
|
|
|
|
|
|
+ rawTracks.transform.decompose( initialPosition, initialRotation, initialScale );
|
|
|
|
|
|
initialPosition = initialPosition.toArray();
|
|
initialPosition = initialPosition.toArray();
|
|
initialRotation = new THREE.Euler().setFromQuaternion( initialRotation, rawTracks.eulerOrder ).toArray();
|
|
initialRotation = new THREE.Euler().setFromQuaternion( initialRotation, rawTracks.eulerOrder ).toArray();
|