Skip to content

Commit ea9df15

Browse files
committed
only force export on gameobject (light/camera) driven by clip
1 parent 2d7a75b commit ea9df15

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2341,13 +2341,9 @@ public void ComputeObjectsInAnimationClips(
23412341
GameObject animationRootObject,
23422342
bool exportSkinnedMeshAnim = true
23432343
){
2344-
// Force export of FbxNodeAttribute for camera and light with animation
2345-
// so that they point the right way when imported into Maya.
2346-
if (animationRootObject.GetComponent<Light>())
2347-
this.exportComponent[animationRootObject] = typeof(Light);
2348-
else if (animationRootObject.GetComponent<Camera>())
2349-
this.exportComponent[animationRootObject] = typeof(Camera);
2350-
2344+
// NOTE: the object (animationRootObject) containing the animation is not necessarily animated
2345+
// when driven by an animator or animation component.
2346+
23512347
foreach (var animClip in animClips) {
23522348
if (this.animationClips.ContainsKey(animClip)) {
23532349
// we have already exported gameobjects for this clip
@@ -2371,6 +2367,8 @@ public void ComputeObjectsInAnimationClips(
23712367
continue;
23722368
}
23732369

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.
23742372
if (unityGo.GetComponent<Light>())
23752373
this.exportComponent[unityGo] = typeof(Light);
23762374
else if (unityGo.GetComponent<Camera>())

0 commit comments

Comments
 (0)