Skip to content

Commit 4ad6cd9

Browse files
committed
Merge branch 'master' into UNI-48338-standardized-fbxsdk-namespace
2 parents 66f729e + d12651d commit 4ad6cd9

File tree

18 files changed

+493
-356
lines changed

18 files changed

+493
-356
lines changed
Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
using UnityEngine;
2-
using UnityEditor;
32
using NUnit.Framework;
43
using FbxExporters.Editor;
54
using UnityEngine.Timeline;
65
using UnityEngine.Playables;
76
using UnityEditor.SceneManagement;
7+
using System.Collections.Generic;
88

99
namespace FbxExporters.UnitTests
1010
{
@@ -22,35 +22,31 @@ public void ExportSingleTimelineClipTest()
2222
{
2323
GameObject myCube = GameObject.Find("CubeSpecial");
2424
string folderPath = GetRandomFileNamePath(extName: "");
25+
string filePath = null;
26+
var exportData = new Dictionary<GameObject, IExportData>();
2527

2628
PlayableDirector pd = myCube.GetComponent<PlayableDirector> ();
2729
if (pd != null) {
2830
foreach (PlayableBinding output in pd.playableAsset.outputs) {
2931
AnimationTrack at = output.sourceObject as AnimationTrack;
3032

3133
GameObject atObject = pd.GetGenericBinding (output.sourceObject) as GameObject;
34+
Assert.That (atObject, Is.Not.Null);
35+
3236
// One file by animation clip
3337
foreach (TimelineClip timeLineClip in at.GetClips()) {
34-
var filePath = string.Format ("{0}/{1}@{2}", folderPath, atObject.name, "Recorded.fbx");
35-
ModelExporterReflection.ExportSingleTimelineClip (timeLineClip, atObject, filePath);
36-
FileAssert.Exists (filePath);
38+
Assert.That (timeLineClip.animationClip, Is.Not.Null);
39+
40+
filePath = string.Format ("{0}/{1}@{2}", folderPath, atObject.name, "Recorded.fbx");
41+
exportData[atObject] = ModelExporterReflection.GetExportData(atObject, timeLineClip.animationClip);
42+
break;
3743
}
3844
}
3945
}
40-
}
41-
42-
[Test]
43-
public void ExportAllTimelineClipTest()
44-
{
45-
GameObject myCube = GameObject.Find("CubeSpecial");
46-
Selection.objects = new UnityEngine.GameObject[] { myCube };
47-
string folderPath = GetRandomFileNamePath(extName: "");
48-
49-
foreach(GameObject obj in Selection.objects)
50-
{
51-
ModelExporterReflection.ExportAllTimelineClips(obj, folderPath);
52-
FileAssert.Exists(string.Format("{0}/{1}@{2}", folderPath, obj.name, "Recorded.fbx"));
53-
}
46+
Assert.That (filePath, Is.Not.Null);
47+
Assert.That (exportData, Is.Not.Null);
48+
ModelExporterReflection.ExportObjects(filePath, new Object[1]{myCube}, null, exportData);
49+
FileAssert.Exists (filePath);
5450
}
5551
}
5652
}

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

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
using FbxExporters.Editor;
2-
using FbxExporters.EditorTools;
32
using System;
43
using System.Linq;
54
using System.Collections.Generic;
65
using System.Reflection;
76
using UnityEngine.Formats.FbxSdk;
87
using UnityEngine;
9-
using UnityEngine.Timeline;
108

119
namespace FbxExporters.UnitTests
1210
{
@@ -94,6 +92,23 @@ public static bool ExportMaterial(ModelExporter instance, Material unityMaterial
9492
return (bool)InvokeMethod("ExportMaterial", new object[] {unityMaterial,fbxScene,fbxNode},instance);
9593
}
9694

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

162177
}
163178

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

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)