Skip to content

Commit 31a75c7

Browse files
author
AJubrey
committed
[ADDED] option to export in Binary or ascii
1 parent 51ea6a0 commit 31a75c7

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ public override void OnInspectorGUI() {
159159
exportSettings.launchAfterInstallation
160160
);
161161

162+
exportSettings.launchAfterInstallation = EditorGUILayout.Toggle(
163+
new GUIContent("Export in Binary:",
164+
"If false, will export files in ASCII format."),
165+
exportSettings.ExportInBinary
166+
);
167+
162168
GUILayout.FlexibleSpace ();
163169
GUILayout.EndScrollView ();
164170
GUILayout.EndVertical();
@@ -246,6 +252,7 @@ public static string kDefaultAdskRoot {
246252
public bool mayaCompatibleNames;
247253
public bool centerObjects;
248254
public bool launchAfterInstallation;
255+
public bool ExportInBinary;
249256

250257
public int selectedDCCApp = 0;
251258

@@ -274,6 +281,7 @@ protected override void LoadDefaults()
274281
mayaCompatibleNames = true;
275282
centerObjects = true;
276283
launchAfterInstallation = true;
284+
ExportInBinary = true;
277285
convertToModelSavePath = kDefaultSavePath;
278286
dccOptionPaths = null;
279287
dccOptionNames = null;

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,15 @@ public int ExportAll (IEnumerable<UnityEngine.Object> unityExportSet)
981981

982982
// Initialize the exporter.
983983
// fileFormat must be binary if we are embedding textures
984-
int fileFormat = fbxManager.GetIOPluginRegistry ().FindWriterIDByDescription ("FBX ascii (*.fbx)");
984+
int fileFormat;
985+
if (EditorTools.ExportSettings.instance.ExportInBinary)
986+
{
987+
fileFormat = -1;
988+
}
989+
else
990+
{
991+
fileFormat = fbxManager.GetIOPluginRegistry().FindWriterIDByDescription("FBX ascii (*.fbx)");
992+
}
985993

986994
status = fbxExporter.Initialize (m_tempFilePath, fileFormat, fbxManager.GetIOSettings ());
987995
// Check that initialization of the fbxExporter was successful

0 commit comments

Comments
 (0)