@@ -2665,7 +2665,7 @@ public enum TransformExportType { Local, Global, Reset };
2665
2665
///
2666
2666
/// This refreshes the asset database.
2667
2667
/// </summary>
2668
- public int ExportAll ( IEnumerable < UnityEngine . Object > unityExportSet , Dictionary < GameObject , AnimationOnlyExportData > animationExportData )
2668
+ public int ExportAll ( IEnumerable < UnityEngine . Object > unityExportSet , Dictionary < GameObject , AnimationOnlyExportData > animationExportData , TransformExportType exportType = TransformExportType . Global )
2669
2669
{
2670
2670
exportCancelled = false ;
2671
2671
@@ -2769,10 +2769,8 @@ public int ExportAll (IEnumerable<UnityEngine.Object> unityExportSet, Dictionary
2769
2769
}
2770
2770
2771
2771
Vector3 center = Vector3 . zero ;
2772
- var exportType = TransformExportType . Reset ;
2773
- if ( revisedExportSet . Count != 1 ) {
2772
+ if ( exportType == TransformExportType . Global ) {
2774
2773
center = ExportSettings . centerObjects ? FindCenter ( revisedExportSet ) : Vector3 . zero ;
2775
- exportType = TransformExportType . Global ;
2776
2774
}
2777
2775
2778
2776
foreach ( var unityGo in revisedExportSet ) {
@@ -3558,7 +3556,7 @@ private static void OnExport (AnimationExportType exportType = AnimationExportTy
3558
3556
/// Export a list of (Game) objects to FBX file.
3559
3557
/// Use the SaveFile panel to allow user to enter a file name.
3560
3558
/// <summary>
3561
- public static string ExportObjects ( string filePath , UnityEngine . Object [ ] objects = null , AnimationExportType exportType = AnimationExportType . all )
3559
+ public static string ExportObjects ( string filePath , UnityEngine . Object [ ] objects = null , AnimationExportType exportType = AnimationExportType . all , TransformExportType transformExportType = TransformExportType . Global )
3562
3560
{
3563
3561
LastFilePath = filePath ;
3564
3562
@@ -3599,7 +3597,7 @@ public static string ExportObjects (string filePath, UnityEngine.Object[] object
3599
3597
break ;
3600
3598
}
3601
3599
3602
- if ( fbxExporter . ExportAll ( objects , animationExportData ) > 0 ) {
3600
+ if ( fbxExporter . ExportAll ( objects , animationExportData , transformExportType ) > 0 ) {
3603
3601
string message = string . Format ( "Successfully exported: {0}" , filePath ) ;
3604
3602
UnityEngine . Debug . Log ( message ) ;
3605
3603
@@ -3609,9 +3607,9 @@ public static string ExportObjects (string filePath, UnityEngine.Object[] object
3609
3607
return null ;
3610
3608
}
3611
3609
3612
- public static string ExportObject ( string filePath , UnityEngine . Object root , AnimationExportType exportType = AnimationExportType . all )
3610
+ public static string ExportObject ( string filePath , UnityEngine . Object root , AnimationExportType exportType = AnimationExportType . all , TransformExportType transformExportType = TransformExportType . Reset )
3613
3611
{
3614
- return ExportObjects ( filePath , new Object [ ] { root } , exportType ) ;
3612
+ return ExportObjects ( filePath , new Object [ ] { root } , exportType , transformExportType ) ;
3615
3613
}
3616
3614
3617
3615
private static void EnsureDirectory ( string path )
0 commit comments