Skip to content

Commit 64ccd2f

Browse files
committed
make ExportObjects with IExportData and GetExportData internal
don't expose the API yet
1 parent 287b3a0 commit 64ccd2f

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

Assets/com.unity.formats.fbx.tests/ExportTimelineClipTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ public void ExportSingleTimelineClipTest()
3838
Assert.That (timeLineClip.animationClip, Is.Not.Null);
3939

4040
filePath = string.Format ("{0}/{1}@{2}", folderPath, atObject.name, "Recorded.fbx");
41-
exportData[atObject] = ModelExporter.GetExportData(atObject, timeLineClip.animationClip);
41+
exportData[atObject] = ModelExporterReflection.GetExportData(atObject, timeLineClip.animationClip);
4242
break;
4343
}
4444
}
4545
}
4646
Assert.That (filePath, Is.Not.Null);
4747
Assert.That (exportData, Is.Not.Null);
48-
ModelExporter.ExportObjects(filePath, new Object[1]{myCube}, null, exportData);
48+
ModelExporterReflection.ExportObjects(filePath, new Object[1]{myCube}, null, exportData);
4949
FileAssert.Exists (filePath);
5050
}
5151
}

Assets/com.unity.formats.fbx.tests/FbxExporterReflection.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,23 @@ public static bool ExportMaterial(ModelExporter instance, Material unityMaterial
9292
return (bool)InvokeMethod("ExportMaterial", new object[] {unityMaterial,fbxScene,fbxNode},instance);
9393
}
9494

95+
public static string ExportObjects(string filePath,
96+
UnityEngine.Object[] objects = null,
97+
EditorTools.IExportOptions exportOptions = null,
98+
Dictionary<GameObject, IExportData> exportData = null)
99+
{
100+
return (string)InvokeMethodOverload("ExportObjects",
101+
new object[] { filePath, objects, exportOptions, exportData },
102+
new Type[] { typeof(string), typeof(UnityEngine.Object[]), typeof(EditorTools.IExportOptions), typeof(Dictionary<GameObject, IExportData>) });
103+
}
104+
105+
public static IExportData GetExportData(GameObject rootObject, AnimationClip animationClip, EditorTools.IExportOptions exportOptions = null)
106+
{
107+
return (IExportData)InvokeMethodOverload("GetExportData",
108+
new object[] { rootObject, animationClip, exportOptions },
109+
new Type[] { typeof(GameObject), typeof(AnimationClip), typeof(EditorTools.IExportOptions) });
110+
}
111+
95112
// Redefinition of the internal delegate. There might be a way to re-use the one in ModelExporter
96113
public static void RegisterMeshObjectCallback(ModelExporter.GetMeshForObject callback)
97114
{

Packages/com.unity.formats.fbx/Editor/Scripts/FbxExporter.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2938,7 +2938,7 @@ internal static Dictionary<GameObject, IExportData> GetExportData(Object[] objec
29382938
return exportData.Count == 0 ? null : exportData;
29392939
}
29402940

2941-
public static IExportData GetExportData(GameObject rootObject, AnimationClip animationClip, IExportOptions exportOptions = null)
2941+
internal static IExportData GetExportData(GameObject rootObject, AnimationClip animationClip, IExportOptions exportOptions = null)
29422942
{
29432943
if (exportOptions==null)
29442944
exportOptions = DefaultOptions;
@@ -4027,11 +4027,21 @@ private static void OnExport ()
40274027
ExportModelEditorWindow.Init (System.Linq.Enumerable.Cast<UnityEngine.Object> (toExport), isTimelineAnim: false);
40284028
}
40294029

4030+
4031+
public static string ExportObjects(
4032+
string filePath,
4033+
UnityEngine.Object[] objects = null,
4034+
IExportOptions exportOptions = null
4035+
)
4036+
{
4037+
return ExportObjects(filePath, objects, exportOptions, exportData: null);
4038+
}
4039+
40304040
/// <summary>
40314041
/// Export a list of (Game) objects to FBX file.
40324042
/// Use the SaveFile panel to allow user to enter a file name.
40334043
/// <summary>
4034-
public static string ExportObjects (
4044+
internal static string ExportObjects (
40354045
string filePath,
40364046
UnityEngine.Object[] objects = null,
40374047
IExportOptions exportOptions = null,

0 commit comments

Comments
 (0)