Skip to content

Commit af86dab

Browse files
committed
Merge branch 'master' into UNI-48338-standardized-fbxexporter-namespace
2 parents 7a2fab6 + 839e5fe commit af86dab

File tree

18 files changed

+3658
-3511
lines changed

18 files changed

+3658
-3511
lines changed

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

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using UnityEngine.Timeline;
44
using UnityEngine.Playables;
55
using UnityEditor.SceneManagement;
6+
using System.Collections.Generic;
67

78
namespace UnityEditor.Formats.Fbx.Exporter.UnitTests
89
{
@@ -20,35 +21,31 @@ public void ExportSingleTimelineClipTest()
2021
{
2122
GameObject myCube = GameObject.Find("CubeSpecial");
2223
string folderPath = GetRandomFileNamePath(extName: "");
24+
string filePath = null;
25+
var exportData = new Dictionary<GameObject, IExportData>();
2326

2427
PlayableDirector pd = myCube.GetComponent<PlayableDirector> ();
2528
if (pd != null) {
2629
foreach (PlayableBinding output in pd.playableAsset.outputs) {
2730
AnimationTrack at = output.sourceObject as AnimationTrack;
2831

2932
GameObject atObject = pd.GetGenericBinding (output.sourceObject) as GameObject;
33+
Assert.That (atObject, Is.Not.Null);
34+
3035
// One file by animation clip
3136
foreach (TimelineClip timeLineClip in at.GetClips()) {
32-
var filePath = string.Format ("{0}/{1}@{2}", folderPath, atObject.name, "Recorded.fbx");
33-
ModelExporterReflection.ExportSingleTimelineClip (timeLineClip, atObject, filePath);
34-
FileAssert.Exists (filePath);
37+
Assert.That (timeLineClip.animationClip, Is.Not.Null);
38+
39+
filePath = string.Format ("{0}/{1}@{2}", folderPath, atObject.name, "Recorded.fbx");
40+
exportData[atObject] = ModelExporterReflection.GetExportData(atObject, timeLineClip.animationClip);
41+
break;
3542
}
3643
}
3744
}
38-
}
39-
40-
[Test]
41-
public void ExportAllTimelineClipTest()
42-
{
43-
GameObject myCube = GameObject.Find("CubeSpecial");
44-
Selection.objects = new UnityEngine.GameObject[] { myCube };
45-
string folderPath = GetRandomFileNamePath(extName: "");
46-
47-
foreach(GameObject obj in Selection.objects)
48-
{
49-
ModelExporterReflection.ExportAllTimelineClips(obj, folderPath);
50-
FileAssert.Exists(string.Format("{0}/{1}@{2}", folderPath, obj.name, "Recorded.fbx"));
51-
}
45+
Assert.That (filePath, Is.Not.Null);
46+
Assert.That (exportData, Is.Not.Null);
47+
ModelExporterReflection.ExportObjects(filePath, new Object[1]{myCube}, null, exportData);
48+
FileAssert.Exists (filePath);
5249
}
5350
}
5451
}

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

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
using UnityEditor.Formats.Fbx.Exporter;
1+
using UnityEditor.Formats.Fbx.Exporter;
22
using System;
33
using System.Linq;
44
using System.Collections.Generic;
55
using System.Reflection;
66
using UnityEngine.Formats.FbxSdk;
77
using UnityEngine;
8-
using UnityEngine.Timeline;
98

109
namespace UnityEditor.Formats.Fbx.Exporter.UnitTests
1110
{
@@ -93,6 +92,23 @@ public static bool ExportMaterial(ModelExporter instance, Material unityMaterial
9392
return (bool)InvokeMethod("ExportMaterial", new object[] {unityMaterial,fbxScene,fbxNode},instance);
9493
}
9594

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+
96112
// Redefinition of the internal delegate. There might be a way to re-use the one in ModelExporter
97113
public static void RegisterMeshObjectCallback(ModelExporter.GetMeshForObject callback)
98114
{
@@ -160,18 +176,6 @@ public static bool ExportMesh(ModelExporter instance, Mesh mesh, FbxNode fbxNode
160176

161177
}
162178

163-
public static void ExportSingleTimelineClip(TimelineClip timelineClipSelected, GameObject animationTrackGObject, string filePath = null)
164-
{
165-
InvokeMethod("ExportSingleTimelineClip",
166-
new object[] {timelineClipSelected, animationTrackGObject, filePath});
167-
}
168-
169-
public static void ExportAllTimelineClips(GameObject objectWithPlayableDirector, string folderPath, IExportOptions exportOptions = null)
170-
{
171-
InvokeMethod("ExportAllTimelineClips",
172-
new object[] {objectWithPlayableDirector, folderPath, exportOptions});
173-
}
174-
175179
/////////// Helpers ///////////
176180
private static object InvokeMethod(string methodName, object[] argsToPass, ModelExporter instance = null)
177181
{

Assets/com.unity.formats.fbx.tests/Models.meta

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/com.unity.formats.fbx.tests/Models/DefaultMale.meta

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/Integrations/Autodesk/maya/scripts/unitySetupUI.mel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ global string $unityImportIconPath = "import.png";
77
global string $unityExportIconPath = "export.png";
88
global string $unityIconPath = "unity.png";
99

10-
global string $unityFamilyLabel = "The UnityFbxForMaya plugin (v.{Version}) allows you to reliably exchange and review your work between Maya and Unity.";
10+
global string $unityFamilyLabel = "The UnityFbxForMaya plugin (v.1.6.0-preview) allows you to reliably exchange and review your work between Maya and Unity.";
1111
global string $unityImportLabel = "Import an FBX file from a Unity project and auto-configure for exporting";
1212
global string $unityExportModelLabel = "Export Model to Unity";
1313
global string $unityExportAnimLabel = "Export Animation to Unity";

Packages/com.unity.formats.fbx/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
RELEASE NOTES
44

5+
**Version**: 1.6.0-preview
6+
7+
NEW FEATURES
8+
9+
* Added support for physical cameras
10+
11+
FIXES
12+
13+
* Fixed skinned mesh bone update
14+
515
**Version**: 1.5.0-preview
616

717
NEW FEATURES

Packages/com.unity.formats.fbx/Documentation/com.unity.formats.fbx.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# About the FBX Exporter package
22

3-
__Version__: 0.0.6-preview
3+
__Version__: 1.6.0-preview
44

55
The FBX Exporter package provides round-trip workflows between Unity and 3D modeling software. Use this workflow to send geometry, Lights, Cameras, and animation from Unity to Maya, Maya LT, or 3ds Max, and back again, with minimal effort.
66

@@ -16,7 +16,7 @@ The FBX Exporter package includes the following features:
1616

1717
The FBX Exporter package is compatible with the following versions of the Unity Editor:
1818

19-
* 2018.1 and later
19+
* 2018.2 and later
2020

2121
The Unity Integration for Maya feature supports the following versions of Maya:
2222

Packages/com.unity.formats.fbx/Editor/Integrations.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/com.unity.formats.fbx/Editor/Integrations/UnityFbxForMax.zip.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Packages/com.unity.formats.fbx/Editor/Integrations/UnityFbxForMaya.zip.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)