Skip to content

Commit 1abbe9a

Browse files
committed
temporarily added debug logs
1 parent a9821f5 commit 1abbe9a

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,14 +1471,17 @@ public static bool TryGetValue(string uniPropertyName, out FbxPropertyChannelPai
14711471
// Transform Rotation (EULER)
14721472
// NOTE: Quaternion Rotation handled by QuaternionCurve
14731473
if (uniPropertyName.StartsWith ("localEulerAnglesRaw.x", ct)) {
1474+
Debug.Log ("euler export");
14741475
prop = new FbxPropertyChannelPair ("Lcl Rotation", Globals.FBXSDK_CURVENODE_COMPONENT_X);
14751476
return true;
14761477
}
14771478
if (uniPropertyName.StartsWith ("localEulerAnglesRaw.y", ct)) {
1479+
Debug.Log ("euler export");
14781480
prop = new FbxPropertyChannelPair ("Lcl Rotation", Globals.FBXSDK_CURVENODE_COMPONENT_Y);
14791481
return true;
14801482
}
14811483
if (uniPropertyName.StartsWith ("localEulerAnglesRaw.z", ct)) {
1484+
Debug.Log ("euler export");
14821485
prop = new FbxPropertyChannelPair ("Lcl Rotation", Globals.FBXSDK_CURVENODE_COMPONENT_Z);
14831486
return true;
14841487
}
@@ -1586,8 +1589,16 @@ Key [] ComputeKeys(UnityEngine.Quaternion restRotation, FbxNode node) {
15861589
var fbxPreRotationEuler = node.GetRotationActive()
15871590
? node.GetPreRotation(FbxNode.EPivotSet.eSourcePivot)
15881591
: new FbxVector4();
1589-
var fbxPreRotationInverse = new FbxQuaternion();
1590-
fbxPreRotationInverse.ComposeSphericalXYZ(fbxPreRotationEuler);
1592+
//Debug.LogWarning ("rotation active: " + node.GetRotationActive () + ", pre rotation: " + node.GetPreRotation(FbxNode.EPivotSet.eSourcePivot));
1593+
Debug.LogWarning("node name: " + node.GetName());
1594+
1595+
FbxQuaternion fbxPreRotationInverse;// = new FbxQuaternion();
1596+
1597+
FbxAMatrix m = new FbxAMatrix ();
1598+
m.SetR (fbxPreRotationEuler);
1599+
fbxPreRotationInverse = m.GetQ();
1600+
1601+
//fbxPreRotationInverse.ComposeSphericalXYZ(fbxPreRotationEuler);
15911602
fbxPreRotationInverse.Inverse();
15921603

15931604
// If we're only animating along certain coords for some
@@ -1628,6 +1639,8 @@ Key [] ComputeKeys(UnityEngine.Quaternion restRotation, FbxNode node) {
16281639
key.time = FbxTime.FromSecondDouble(seconds);
16291640
key.euler = ModelExporter.ConvertQuaternionToXYZEuler(fbxQuat);
16301641
keys[i++] = key;
1642+
1643+
Debug.Log ("pre rotation: " + fbxPreRotationEuler + ", complete rotation: " + key.euler);
16311644
}
16321645

16331646
// Sort the keys by time
@@ -1752,7 +1765,7 @@ protected void ExportAnimationClip (AnimationClip uniAnimClip, GameObject uniRoo
17521765
foreach (var kvp in quaternions) {
17531766
var unityGo = kvp.Key;
17541767
var quat = kvp.Value;
1755-
1768+
//Debug.LogWarning ("unity object: " + unityGo.name);
17561769
FbxNode fbxNode;
17571770
if (!MapUnityObjectToFbxNode.TryGetValue (unityGo, out fbxNode)) {
17581771
Debug.LogError (string.Format ("no FbxNode found for {0}", unityGo.name));

0 commit comments

Comments
 (0)