@@ -1376,33 +1376,38 @@ protected void ExportAnimationCurve (UnityEngine.Object uniObj,
1376
1376
class UnityToMayaConvertSceneHelper
1377
1377
{
1378
1378
bool convertDistance = false ;
1379
+ bool convertLtoR = false ;
1380
+
1379
1381
float unitScaleFactor = 1f ;
1380
1382
1381
1383
public UnityToMayaConvertSceneHelper ( string uniPropertyName )
1382
1384
{
1383
1385
System . StringComparison cc = System . StringComparison . CurrentCulture ;
1384
1386
1385
- convertDistance |= uniPropertyName . StartsWith ( "m_LocalPosition." , cc ) ;
1386
- convertDistance |= uniPropertyName . StartsWith ( "m_Intensity" , cc ) ;
1387
+ bool partT = uniPropertyName . StartsWith ( "m_LocalPosition." , cc ) ;
1388
+ bool partTx = uniPropertyName . EndsWith ( "Position.x" , cc ) || uniPropertyName . EndsWith ( "T.x" , cc ) ;
1389
+ bool partRy = uniPropertyName . Equals ( "localEulerAnglesRaw.y" , cc ) ;
1390
+ bool partRz = uniPropertyName . Equals ( "localEulerAnglesRaw.z" , cc ) ;
1387
1391
1388
- bool convertLHRH = convertDistance && uniPropertyName . EndsWith ( ".x" , cc ) || uniPropertyName . EndsWith ( "T.x" , cc ) ;
1389
- convertDistance |= convertLHRH ;
1390
- convertDistance |= uniPropertyName . EndsWith ( "T.y" , cc ) ;
1391
- convertDistance |= uniPropertyName . EndsWith ( "T.z " , cc ) ;
1392
+ convertLtoR |= partTx || partRy || partRz ;
1393
+
1394
+ convertDistance |= partT ;
1395
+ convertDistance |= uniPropertyName . StartsWith ( "m_Intensity " , cc ) ;
1392
1396
1393
- if ( convertDistance ) {
1397
+ if ( convertDistance )
1394
1398
unitScaleFactor = ModelExporter . UnitScaleFactor ;
1395
- if ( convertLHRH )
1396
- unitScaleFactor = - unitScaleFactor ;
1397
- }
1399
+
1400
+ if ( convertLtoR )
1401
+ unitScaleFactor = - unitScaleFactor ;
1398
1402
}
1399
1403
1400
1404
public float Convert ( float value )
1401
1405
{
1402
1406
// left handed to right handed conversion
1403
1407
// meters to centimetres conversion
1404
- return ( convertDistance ) ? unitScaleFactor * value : value ;
1408
+ return unitScaleFactor * value ;
1405
1409
}
1410
+
1406
1411
}
1407
1412
1408
1413
/// <summary>
@@ -1438,7 +1443,20 @@ public static bool TryGetValue(string uniPropertyName, out FbxPropertyChannelPai
1438
1443
return true ;
1439
1444
}
1440
1445
1441
- // NOTE: Transform Rotation handled by QuaternionCurve
1446
+ // Transform Rotation (EULER)
1447
+ // NOTE: Quaternion Rotation handled by QuaternionCurve
1448
+ if ( uniPropertyName . StartsWith ( "localEulerAnglesRaw.x" , ct ) ) {
1449
+ prop = new FbxPropertyChannelPair ( "Lcl Rotation" , Globals . FBXSDK_CURVENODE_COMPONENT_X ) ;
1450
+ return true ;
1451
+ }
1452
+ if ( uniPropertyName . StartsWith ( "localEulerAnglesRaw.y" , ct ) ) {
1453
+ prop = new FbxPropertyChannelPair ( "Lcl Rotation" , Globals . FBXSDK_CURVENODE_COMPONENT_Y ) ;
1454
+ return true ;
1455
+ }
1456
+ if ( uniPropertyName . StartsWith ( "localEulerAnglesRaw.z" , ct ) ) {
1457
+ prop = new FbxPropertyChannelPair ( "Lcl Rotation" , Globals . FBXSDK_CURVENODE_COMPONENT_Z ) ;
1458
+ return true ;
1459
+ }
1442
1460
1443
1461
// Transform Translation
1444
1462
if ( uniPropertyName . StartsWith ( "m_LocalPosition.x" , ct ) || uniPropertyName . EndsWith ( "T.x" , ct ) ) {
0 commit comments