@@ -1993,8 +1993,10 @@ public UnityToMayaConvertSceneHelper(string uniPropertyName)
1993
1993
1994
1994
bool partT = uniPropertyName . StartsWith ( "m_LocalPosition." , cc ) || uniPropertyName . StartsWith ( "m_TranslationOffset." , cc ) ;
1995
1995
bool partTx = uniPropertyName . EndsWith ( "Position.x" , cc ) || uniPropertyName . EndsWith ( "T.x" , cc ) || uniPropertyName . EndsWith ( "TranslationOffset.x" , cc ) ;
1996
+ bool partRyz = uniPropertyName . StartsWith ( "m_RotationOffset" , cc ) && ( uniPropertyName . EndsWith ( ".y" ) || uniPropertyName . EndsWith ( ".z" ) ) ;
1996
1997
1997
1998
convertLtoR |= partTx ;
1999
+ convertLtoR |= partRyz ;
1998
2000
1999
2001
convertDistance |= partT ;
2000
2002
convertDistance |= uniPropertyName . StartsWith ( "m_Intensity" , cc ) ;
@@ -2029,12 +2031,19 @@ struct FbxPropertyChannelPair {
2029
2031
{ "S" , "Lcl Scaling" } ,
2030
2032
{ "m_LocalPosition" , "Lcl Translation" } ,
2031
2033
{ "T" , "Lcl Translation" } ,
2034
+ { "m_TranslationOffset" , "Translation" } ,
2035
+ { "m_ScaleOffset" , "Scaling" } ,
2036
+ { "m_RotationOffset" , "Rotation" }
2037
+ } ;
2038
+
2039
+ private static Dictionary < string , string > AimConstraintProperties = new Dictionary < string , string > ( )
2040
+ {
2032
2041
{ "m_AimVector" , "AimVector" } ,
2033
2042
{ "m_UpVector" , "UpVector" } ,
2034
2043
{ "m_WorldUpVector" , "WorldUpVector" } ,
2035
- { "m_TranslationOffset" , "Translation" } ,
2036
- { "m_ScaleOffset" , "Scaling" }
2044
+ { "m_RotationOffset" , "RotationOffset" }
2037
2045
} ;
2046
+
2038
2047
private static Dictionary < string , string > TransformChannels = new Dictionary < string , string > ( )
2039
2048
{
2040
2049
{ "x" , Globals . FBXSDK_CURVENODE_COMPONENT_X } ,
@@ -2059,7 +2068,9 @@ struct FbxPropertyChannelPair {
2059
2068
} ;
2060
2069
private static Dictionary < string , string > ConstraintSourceProperties = new Dictionary < string , string > ( )
2061
2070
{
2062
- { "m_Sources\\ .Array\\ .data\\ [(\\ d+)\\ ]\\ .weight" , "{0}.Weight" }
2071
+ { "m_Sources\\ .Array\\ .data\\ [(\\ d+)\\ ]\\ .weight" , "{0}.Weight" } ,
2072
+ { "m_TranslationOffsets\\ .Array\\ .data\\ [(\\ d+)\\ ]" , "{0}.Offset T" } ,
2073
+ { "m_RotationOffsets\\ .Array\\ .data\\ [\\ d+)\\ ]" , "{0}.Offset R" }
2063
2074
} ;
2064
2075
2065
2076
public FbxPropertyChannelPair ( string p , string c ) : this ( ) {
@@ -2150,9 +2161,21 @@ public static bool TryGetValue(string uniPropertyName, out FbxPropertyChannelPai
2150
2161
return true ;
2151
2162
}
2152
2163
2153
- if ( constraint != null && TryGetConstraintSourceChannelPairs ( uniPropertyName , constraint , ref prop ) )
2164
+ if ( constraint != null )
2154
2165
{
2155
- return true ;
2166
+ // Aim constraint shares the RotationOffset property with RotationConstraint, so make sure that the correct FBX property is returned
2167
+ if ( constraint . GetConstraintType ( ) == FbxConstraint . EType . eAim )
2168
+ {
2169
+ if ( TryGetChannelPairs ( uniPropertyName , propFormat , AimConstraintProperties , TransformChannels , ref prop ) )
2170
+ {
2171
+ return true ;
2172
+ }
2173
+ }
2174
+
2175
+ if ( TryGetConstraintSourceChannelPairs ( uniPropertyName , constraint , ref prop ) )
2176
+ {
2177
+ return true ;
2178
+ }
2156
2179
}
2157
2180
2158
2181
return false ;
0 commit comments