Skip to content

Commit e21e708

Browse files
committed
code review fixes
1 parent 759f3ea commit e21e708

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,6 +2134,10 @@ public struct AnimationOnlyExportData {
21342134
// first clip to export
21352135
public AnimationClip defaultClip;
21362136

2137+
// TODO: find a better way to keep track of which components + properties we support
2138+
private static List<string> cameraProps = new List<string>{"field of view"};
2139+
private static List<string> lightProps = new List<string>{"m_Intensity", "m_SpotAngle", "m_Color.r", "m_Color.g", "m_Color.b"};
2140+
21372141
public AnimationOnlyExportData(
21382142
Dictionary<AnimationClip, GameObject> animClips,
21392143
HashSet<GameObject> exportSet,
@@ -2149,10 +2153,6 @@ public void ComputeObjectsInAnimationClips(
21492153
AnimationClip[] animClips,
21502154
GameObject animationRootObject
21512155
){
2152-
// TODO: find a better way to keep track of which components + properties we support
2153-
var cameraProps = new List<string>{"field of view"};
2154-
var lightProps = new List<string>{"m_Intensity", "m_SpotAngle", "m_Color.r", "m_Color.g", "m_Color.b"};
2155-
21562156
foreach (var animClip in animClips) {
21572157
if (this.animationClips.ContainsKey(animClip)) {
21582158
// we have already exported gameobjects for this clip
@@ -2282,7 +2282,7 @@ public SkinnedMeshBoneInfo(SkinnedMeshRenderer skinnedMesh, Dictionary<Transform
22822282
}
22832283

22842284
/// <summary>
2285-
/// Exports the Gameobject and it's ancestors.
2285+
/// Exports the Gameobject and its ancestors.
22862286
/// </summary>
22872287
/// <returns><c>true</c>, if game object and parents were exported,
22882288
/// <c>false</c> if export cancelled.</returns>
@@ -2451,7 +2451,7 @@ private bool ExportBoneTransform(
24512451
/// <returns>The object to root count.</returns>
24522452
/// <param name="startObject">Start object.</param>
24532453
/// <param name="root">Root object.</param>
2454-
private int GetObjectToRootCount(Transform startObject, Transform root){
2454+
private int GetObjectToRootDepth(Transform startObject, Transform root){
24552455
if (startObject == null) {
24562456
return 0;
24572457
}
@@ -2495,27 +2495,27 @@ out Dictionary<GameObject, AnimationOnlyExportData> hierarchyToExportData
24952495

24962496
hierarchyToExportData.Add (go, exportData);
24972497

2498-
int fromRoot = int.MaxValue;
2498+
int depthFromRootAnimation = int.MaxValue;
24992499
Animation rootAnimation = null;
25002500
foreach (var anim in legacyAnim) {
2501-
int count = GetObjectToRootCount(anim.transform, go.transform);
2501+
int count = GetObjectToRootDepth(anim.transform, go.transform);
25022502

2503-
if (count < fromRoot) {
2504-
fromRoot = count;
2503+
if (count < depthFromRootAnimation) {
2504+
depthFromRootAnimation = count;
25052505
rootAnimation = anim;
25062506
}
25072507

25082508
var animClips = AnimationUtility.GetAnimationClips (anim.gameObject);
25092509
exportData.ComputeObjectsInAnimationClips (animClips, anim.gameObject);
25102510
}
25112511

2512-
int aFromRoot = int.MaxValue;
2512+
int depthFromRootAnimator = int.MaxValue;
25132513
Animator rootAnimator = null;
25142514
foreach (var anim in genericAnim) {
2515-
int count = GetObjectToRootCount(anim.transform, go.transform);
2515+
int count = GetObjectToRootDepth(anim.transform, go.transform);
25162516

2517-
if (count < aFromRoot) {
2518-
aFromRoot = count;
2517+
if (count < depthFromRootAnimator) {
2518+
depthFromRootAnimator = count;
25192519
rootAnimator = anim;
25202520
}
25212521

@@ -2528,7 +2528,7 @@ out Dictionary<GameObject, AnimationOnlyExportData> hierarchyToExportData
25282528
}
25292529

25302530
// set the first clip to export
2531-
if (fromRoot < aFromRoot) {
2531+
if (depthFromRootAnimation < depthFromRootAnimator) {
25322532
exportData.defaultClip = rootAnimation.clip;
25332533
} else {
25342534
// Try the animator controller (mecanim)

0 commit comments

Comments
 (0)