Skip to content

Commit 3c0a4c1

Browse files
committed
small fixes
1 parent 20fa84f commit 3c0a4c1

File tree

2 files changed

+10
-23
lines changed

2 files changed

+10
-23
lines changed

Packages/com.unity.formats.fbx/Editor/Scripts/ExportModelEditorWindow.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -482,14 +482,16 @@ protected int SetGameObjectsToExport(IEnumerable<UnityEngine.Object> toExport){
482482
TransferAnimationDest = null;
483483

484484
// if only one object selected, set transfer source/dest to this object
485-
GameObject go = GetGameObject();
486-
487-
if (go) {
488-
TransferAnimationSource = go.transform;
489-
TransferAnimationDest = go.transform;
485+
if (ToExport.Length == 1 || (IsTimelineAnim && ToExport.Length > 0))
486+
{
487+
GameObject go = GetGameObject();
488+
if (go)
489+
{
490+
TransferAnimationSource = go.transform;
491+
TransferAnimationDest = go.transform;
492+
}
490493
}
491-
492-
return 1;
494+
return ToExport.Length;
493495
}
494496

495497
/// <summary>

Packages/com.unity.formats.fbx/Editor/Scripts/FbxExporter.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2633,23 +2633,8 @@ IExportOptions exportOptions
26332633
Debug.Assert(rootObject!=null);
26342634
Debug.Assert(exportOptions!=null);
26352635

2636-
// if we're exporting animation-only and the root is a Camera or Light then we also
2637-
// to export the static values so that these are pointing the right way
2638-
if (exportOptions.ModelAnimIncludeOption == ExportSettings.Include.Anim)
2639-
{
2640-
if (rootObject.GetComponent<Light>())
2641-
{
2642-
this.exportComponent.Add (rootObject, typeof(Light));
2643-
}
2644-
else if (rootObject.GetComponent<Camera>())
2645-
{
2646-
this.exportComponent.Add (rootObject, typeof(Camera));
2647-
}
2648-
this.goExportSet.Add (rootObject);
2649-
}
26502636
// NOTE: the object (animationRootObject) containing the animation is not necessarily animated
26512637
// when driven by an animator or animation component.
2652-
26532638
foreach (var animClip in animClips) {
26542639
if (this.animationClips.ContainsKey(animClip)) {
26552640
// we have already exported gameobjects for this clip
@@ -2685,7 +2670,7 @@ IExportOptions exportOptions
26852670
}
26862671
}
26872672

2688-
internal static GameObject GetGameObjectBoundToEditorClip(object editorClip)
2673+
public static GameObject GetGameObjectBoundToEditorClip(object editorClip)
26892674
{
26902675
object clipItem = editorClip.GetType().GetProperty("item").GetValue(editorClip, null);
26912676
object parentTrack = clipItem.GetType().GetProperty("parentTrack").GetValue(clipItem, null);

0 commit comments

Comments
 (0)