Skip to content

Commit 39cbae0

Browse files
committed
set default transform export type to Global
- only use reset if using convert to model - set center objects option to false by default
1 parent c217443 commit 39cbae0

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ public static string[] DCCVendorLocations
431431

432432
// Note: default values are set in LoadDefaults().
433433
public bool mayaCompatibleNames = true;
434-
public bool centerObjects = true;
434+
public bool centerObjects = false;
435435
public bool autoUpdaterEnabled = true;
436436
public bool launchAfterInstallation = true;
437437
public bool HideSendToUnityMenu = true;

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2665,7 +2665,7 @@ public enum TransformExportType { Local, Global, Reset };
26652665
///
26662666
/// This refreshes the asset database.
26672667
/// </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)
26692669
{
26702670
exportCancelled = false;
26712671

@@ -2769,10 +2769,8 @@ public int ExportAll (IEnumerable<UnityEngine.Object> unityExportSet, Dictionary
27692769
}
27702770

27712771
Vector3 center = Vector3.zero;
2772-
var exportType = TransformExportType.Reset;
2773-
if(revisedExportSet.Count != 1){
2772+
if(exportType == TransformExportType.Global){
27742773
center = ExportSettings.centerObjects? FindCenter(revisedExportSet) : Vector3.zero;
2775-
exportType = TransformExportType.Global;
27762774
}
27772775

27782776
foreach (var unityGo in revisedExportSet) {
@@ -3558,7 +3556,7 @@ private static void OnExport (AnimationExportType exportType = AnimationExportTy
35583556
/// Export a list of (Game) objects to FBX file.
35593557
/// Use the SaveFile panel to allow user to enter a file name.
35603558
/// <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)
35623560
{
35633561
LastFilePath = filePath;
35643562

@@ -3599,7 +3597,7 @@ public static string ExportObjects (string filePath, UnityEngine.Object[] object
35993597
break;
36003598
}
36013599

3602-
if (fbxExporter.ExportAll (objects, animationExportData) > 0) {
3600+
if (fbxExporter.ExportAll (objects, animationExportData, transformExportType) > 0) {
36033601
string message = string.Format ("Successfully exported: {0}", filePath);
36043602
UnityEngine.Debug.Log (message);
36053603

@@ -3609,9 +3607,9 @@ public static string ExportObjects (string filePath, UnityEngine.Object[] object
36093607
return null;
36103608
}
36113609

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)
36133611
{
3614-
return ExportObjects(filePath, new Object[] { root }, exportType);
3612+
return ExportObjects(filePath, new Object[] { root }, exportType, transformExportType);
36153613
}
36163614

36173615
private static void EnsureDirectory (string path)

0 commit comments

Comments
 (0)