@@ -2325,10 +2325,6 @@ public struct AnimationOnlyExportData {
2325
2325
// first clip to export
2326
2326
public AnimationClip defaultClip ;
2327
2327
2328
- // TODO: find a better way to keep track of which components + properties we support
2329
- private static List < string > cameraProps = new List < string > { "field of view" } ;
2330
- private static List < string > lightProps = new List < string > { "m_Intensity" , "m_SpotAngle" , "m_Color.r" , "m_Color.g" , "m_Color.b" } ;
2331
-
2332
2328
public AnimationOnlyExportData (
2333
2329
Dictionary < AnimationClip , GameObject > animClips ,
2334
2330
HashSet < GameObject > exportSet ,
@@ -2345,6 +2341,9 @@ public void ComputeObjectsInAnimationClips(
2345
2341
GameObject animationRootObject ,
2346
2342
bool exportSkinnedMeshAnim = true
2347
2343
) {
2344
+ // NOTE: the object (animationRootObject) containing the animation is not necessarily animated
2345
+ // when driven by an animator or animation component.
2346
+
2348
2347
foreach ( var animClip in animClips ) {
2349
2348
if ( this . animationClips . ContainsKey ( animClip ) ) {
2350
2349
// we have already exported gameobjects for this clip
@@ -2368,11 +2367,12 @@ public void ComputeObjectsInAnimationClips(
2368
2367
continue ;
2369
2368
}
2370
2369
2371
- if ( lightProps . Contains ( uniCurveBinding . propertyName ) ) {
2372
- this . exportComponent . Add ( unityGo , typeof ( Light ) ) ;
2373
- } else if ( cameraProps . Contains ( uniCurveBinding . propertyName ) ) {
2374
- this . exportComponent . Add ( unityGo , typeof ( Camera ) ) ;
2375
- }
2370
+ // If we have a clip driving a camera or light then force the export of FbxNodeAttribute
2371
+ // so that they point the right way when imported into Maya.
2372
+ if ( unityGo . GetComponent < Light > ( ) )
2373
+ this . exportComponent [ unityGo ] = typeof ( Light ) ;
2374
+ else if ( unityGo . GetComponent < Camera > ( ) )
2375
+ this . exportComponent [ unityGo ] = typeof ( Camera ) ;
2376
2376
2377
2377
this . goExportSet . Add ( unityGo ) ;
2378
2378
}
0 commit comments