@@ -1401,33 +1401,38 @@ protected void ExportAnimationCurve (UnityEngine.Object uniObj,
1401
1401
class UnityToMayaConvertSceneHelper
1402
1402
{
1403
1403
bool convertDistance = false ;
1404
+ bool convertLtoR = false ;
1405
+
1404
1406
float unitScaleFactor = 1f ;
1405
1407
1406
1408
public UnityToMayaConvertSceneHelper ( string uniPropertyName )
1407
1409
{
1408
1410
System . StringComparison cc = System . StringComparison . CurrentCulture ;
1409
1411
1410
- convertDistance |= uniPropertyName . StartsWith ( "m_LocalPosition." , cc ) ;
1411
- convertDistance |= uniPropertyName . StartsWith ( "m_Intensity" , cc ) ;
1412
+ bool partT = uniPropertyName . StartsWith ( "m_LocalPosition." , cc ) ;
1413
+ bool partTx = uniPropertyName . EndsWith ( "Position.x" , cc ) || uniPropertyName . EndsWith ( "T.x" , cc ) ;
1414
+ bool partRy = uniPropertyName . Equals ( "localEulerAnglesRaw.y" , cc ) ;
1415
+ bool partRz = uniPropertyName . Equals ( "localEulerAnglesRaw.z" , cc ) ;
1412
1416
1413
- bool convertLHRH = convertDistance && uniPropertyName . EndsWith ( ".x" , cc ) || uniPropertyName . EndsWith ( "T.x" , cc ) ;
1414
- convertDistance |= convertLHRH ;
1415
- convertDistance |= uniPropertyName . EndsWith ( "T.y" , cc ) ;
1416
- convertDistance |= uniPropertyName . EndsWith ( "T.z " , cc ) ;
1417
+ convertLtoR |= partTx || partRy || partRz ;
1418
+
1419
+ convertDistance |= partT ;
1420
+ convertDistance |= uniPropertyName . StartsWith ( "m_Intensity " , cc ) ;
1417
1421
1418
- if ( convertDistance ) {
1422
+ if ( convertDistance )
1419
1423
unitScaleFactor = ModelExporter . UnitScaleFactor ;
1420
- if ( convertLHRH )
1421
- unitScaleFactor = - unitScaleFactor ;
1422
- }
1424
+
1425
+ if ( convertLtoR )
1426
+ unitScaleFactor = - unitScaleFactor ;
1423
1427
}
1424
1428
1425
1429
public float Convert ( float value )
1426
1430
{
1427
1431
// left handed to right handed conversion
1428
1432
// meters to centimetres conversion
1429
- return ( convertDistance ) ? unitScaleFactor * value : value ;
1433
+ return unitScaleFactor * value ;
1430
1434
}
1435
+
1431
1436
}
1432
1437
1433
1438
/// <summary>
@@ -1463,7 +1468,20 @@ public static bool TryGetValue(string uniPropertyName, out FbxPropertyChannelPai
1463
1468
return true ;
1464
1469
}
1465
1470
1466
- // NOTE: Transform Rotation handled by QuaternionCurve
1471
+ // Transform Rotation (EULER)
1472
+ // NOTE: Quaternion Rotation handled by QuaternionCurve
1473
+ if ( uniPropertyName . StartsWith ( "localEulerAnglesRaw.x" , ct ) ) {
1474
+ prop = new FbxPropertyChannelPair ( "Lcl Rotation" , Globals . FBXSDK_CURVENODE_COMPONENT_X ) ;
1475
+ return true ;
1476
+ }
1477
+ if ( uniPropertyName . StartsWith ( "localEulerAnglesRaw.y" , ct ) ) {
1478
+ prop = new FbxPropertyChannelPair ( "Lcl Rotation" , Globals . FBXSDK_CURVENODE_COMPONENT_Y ) ;
1479
+ return true ;
1480
+ }
1481
+ if ( uniPropertyName . StartsWith ( "localEulerAnglesRaw.z" , ct ) ) {
1482
+ prop = new FbxPropertyChannelPair ( "Lcl Rotation" , Globals . FBXSDK_CURVENODE_COMPONENT_Z ) ;
1483
+ return true ;
1484
+ }
1467
1485
1468
1486
// Transform Translation
1469
1487
if ( uniPropertyName . StartsWith ( "m_LocalPosition.x" , ct ) || uniPropertyName . EndsWith ( "T.x" , ct ) ) {
0 commit comments