Skip to content

Commit 44a9cc3

Browse files
committed
include parent gameobjects in export count
1 parent cd25932 commit 44a9cc3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,12 +2458,20 @@ out Dictionary<GameObject, AnimationOnlyExportData> hierarchyToExportData
24582458
}
24592459
}
24602460

2461-
int count = 0;
2461+
// including any parents of animated objects that are exported
2462+
var completeExpSet = new HashSet<GameObject>();
24622463
foreach (var data in hierarchyToExportData.Values) {
2463-
count += data.goExportSet.Count;
2464+
foreach (var go in data.goExportSet) {
2465+
completeExpSet.Add (go);
2466+
2467+
var parent = go.transform.parent;
2468+
while (parent != null && completeExpSet.Add (parent.gameObject)) {
2469+
parent = parent.parent;
2470+
}
2471+
}
24642472
}
24652473

2466-
return count;
2474+
return completeExpSet.Count;
24672475
}
24682476

24692477
protected void GetObjectsInAnimationClips(

0 commit comments

Comments
 (0)