@@ -2182,7 +2182,7 @@ protected void ExportAnimationOnly(
2182
2182
int exportProgress ,
2183
2183
int objectCount ,
2184
2184
Vector3 newCenter ,
2185
- HashSet < AnimationClip > animationClips ,
2185
+ Dictionary < AnimationClip , GameObject > animationClips ,
2186
2186
HashSet < GameObject > goExportSet ,
2187
2187
Dictionary < GameObject , System . Type > exportComponent ,
2188
2188
TransformExportType exportType = TransformExportType . Local
@@ -2235,7 +2235,7 @@ protected void ExportAnimationOnly(
2235
2235
2236
2236
// export animation
2237
2237
foreach ( var animClip in animationClips ) {
2238
- // ExportAnimationClip (animClip, animationRootObject , fbxScene);
2238
+ ExportAnimationClip ( animClip . Key , animClip . Value , fbxScene ) ;
2239
2239
}
2240
2240
}
2241
2241
@@ -2394,11 +2394,11 @@ private bool ExportBoneTransform(
2394
2394
2395
2395
protected int AnimOnlyHierarchyCount (
2396
2396
HashSet < GameObject > exportSet ,
2397
- out HashSet < AnimationClip > animationClips ,
2397
+ out Dictionary < AnimationClip , GameObject > animationClips ,
2398
2398
out Dictionary < GameObject , HashSet < GameObject > > mapGameObjectToExportSet ,
2399
2399
out Dictionary < GameObject , System . Type > exportComponent
2400
2400
) {
2401
- animationClips = new HashSet < AnimationClip > ( ) ;
2401
+ animationClips = new Dictionary < AnimationClip , GameObject > ( ) ;
2402
2402
mapGameObjectToExportSet = new Dictionary < GameObject , HashSet < GameObject > > ( ) ;
2403
2403
exportComponent = new Dictionary < GameObject , System . Type > ( ) ;
2404
2404
@@ -2436,19 +2436,21 @@ protected int AnimOnlyHierarchyCount(
2436
2436
protected void GetObjectsInAnimationClips (
2437
2437
AnimationClip [ ] animClips ,
2438
2438
GameObject animationRootObject ,
2439
- ref HashSet < AnimationClip > clipSet ,
2439
+ ref Dictionary < AnimationClip , GameObject > clipSet ,
2440
2440
ref HashSet < GameObject > goToExport ,
2441
2441
ref Dictionary < GameObject , System . Type > exportComponent
2442
2442
) {
2443
2443
var cameraProps = new List < string > { "field of view" } ;
2444
2444
var lightProps = new List < string > { "m_Intensity" , "m_SpotAngle" , "m_Color.r" , "m_Color.g" , "m_Color.b" } ;
2445
2445
2446
2446
foreach ( var animClip in animClips ) {
2447
- if ( ! clipSet . Add ( animClip ) ) {
2447
+ if ( clipSet . ContainsKey ( animClip ) ) {
2448
2448
// we have already exported gameobjects for this clip
2449
2449
continue ;
2450
2450
}
2451
2451
2452
+ clipSet . Add ( animClip , animationRootObject ) ;
2453
+
2452
2454
foreach ( EditorCurveBinding uniCurveBinding in AnimationUtility . GetCurveBindings ( animClip ) ) {
2453
2455
Object uniObj = AnimationUtility . GetAnimatedObject ( animationRootObject , uniCurveBinding ) ;
2454
2456
if ( ! uniObj ) {
0 commit comments