Skip to content

Commit 168eb78

Browse files
authored
Merge pull request #327 from Unity-Technologies/UNI-40130-sprint48-release
UNI-40130 sprint 48 release
2 parents 930662b + b3a7205 commit 168eb78

File tree

6 files changed

+49
-37
lines changed

6 files changed

+49
-37
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ public override void OnInspectorGUI() {
5757
);
5858

5959
exportSettings.exportMeshNoRenderer = EditorGUILayout.Toggle(
60-
new GUIContent("Export Meshes with no Renderers:",
61-
"If unchecked, meshes that don't have renderers won't be exported."),
60+
new GUIContent("Export Unrendered:",
61+
"If checked, meshes will be exported even if they don't have a Renderer component."),
6262
exportSettings.exportMeshNoRenderer
6363
);
6464

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2951,29 +2951,18 @@ private void ReplaceFile ()
29512951
[MenuItem(TimelineClipMenuItemName, false, 31)]
29522952
static void OnClipContextClick(MenuCommand command)
29532953
{
2954-
// Now that we know we have stuff to export, get the user-desired path.
2955-
string directory = string.IsNullOrEmpty(LastFilePath)
2956-
? Application.dataPath
2957-
: System.IO.Path.GetDirectoryName(LastFilePath);
2958-
2959-
string title = "Select the folder in which the animation files from the timeline will be exported";
2960-
string folderPath = EditorUtility.SaveFolderPanel(title, directory, "");
2961-
2962-
if (string.IsNullOrEmpty(folderPath))
2963-
{
2964-
return;
2965-
}
2966-
Debug.Log(folderPath);
2967-
29682954
Object[] selectedObjects = Selection.objects;
29692955

29702956
foreach (Object editorClipSelected in selectedObjects)
29712957
{
2972-
ExportSingleEditorClip(editorClipSelected, folderPath);
2958+
// export first selected editor clip.
2959+
if (ExportSingleEditorClip (editorClipSelected)) {
2960+
return;
2961+
}
29732962
}
29742963
}
29752964

2976-
public static void ExportSingleEditorClip(Object editorClipSelected, string folderPath)
2965+
public static bool ExportSingleEditorClip(Object editorClipSelected)
29772966
{
29782967
if (editorClipSelected.GetType().Name.Contains("EditorClip"))
29792968
{
@@ -2985,15 +2974,25 @@ public static void ExportSingleEditorClip(Object editorClipSelected, string fold
29852974
AnimationTrack editorClipAnimationTrack = selClipItemParentTrack as AnimationTrack;
29862975
GameObject animationTrackGObject = UnityEditor.Timeline.TimelineEditor.playableDirector.GetGenericBinding (editorClipAnimationTrack) as GameObject;
29872976

2988-
ExportSingleTimelineClip(timeLineClip, folderPath, animationTrackGObject);
2977+
ExportSingleTimelineClip(timeLineClip, animationTrackGObject);
2978+
return true;
29892979
}
2980+
return false;
29902981
}
29912982

2992-
public static void ExportSingleTimelineClip(TimelineClip timelineClipSelected, string folderPath, GameObject animationTrackGObject)
2983+
public static void ExportSingleTimelineClip(TimelineClip timelineClipSelected, GameObject animationTrackGObject, string filePath = null)
29932984
{
2994-
string filePath = folderPath + "/" + animationTrackGObject.name + "@" + timelineClipSelected.animationClip.name + ".fbx";
2995-
UnityEngine.Object[] myArray = new UnityEngine.Object[] { animationTrackGObject, timelineClipSelected.animationClip };
2996-
ExportObjects(filePath, myArray, AnimationExportType.timelineAnimationClip);
2985+
if (string.IsNullOrEmpty (filePath)) {
2986+
filePath = GetExportFilePath (animationTrackGObject.name + "@" + timelineClipSelected.displayName);
2987+
}
2988+
if (string.IsNullOrEmpty (filePath)) {
2989+
return;
2990+
}
2991+
UnityEngine.Object[] myArray = new UnityEngine.Object[] {
2992+
animationTrackGObject,
2993+
timelineClipSelected.animationClip
2994+
};
2995+
ExportObjects (filePath, myArray, AnimationExportType.timelineAnimationClip);
29972996
}
29982997

29992998
/// <summary>
@@ -3040,8 +3039,6 @@ public static void OnPlayableDirectorGameObjectContextClick(MenuCommand command)
30403039

30413040
public static void ExportAllTimelineClips(GameObject objectWithPlayableDirector, string folderPath)
30423041
{
3043-
Debug.Log(objectWithPlayableDirector.GetType().BaseType.ToString() + ":" + objectWithPlayableDirector.name);
3044-
30453042
PlayableDirector pd = objectWithPlayableDirector.GetComponent<PlayableDirector>();
30463043
if (pd != null)
30473044
{
@@ -3050,13 +3047,12 @@ public static void ExportAllTimelineClips(GameObject objectWithPlayableDirector,
30503047
AnimationTrack at = output.sourceObject as AnimationTrack;
30513048

30523049
GameObject atObject = pd.GetGenericBinding(output.sourceObject) as GameObject;
3053-
// One file by animation clip
3054-
foreach(TimelineClip timeLineClip in at.GetClips())
3055-
{
3056-
string filePath = folderPath + "/" + atObject.name + "@" + timeLineClip.animationClip.name + ".fbx";
3057-
UnityEngine.Object[] myArray = new UnityEngine.Object[] { atObject, timeLineClip.animationClip };
3058-
ExportObjects(filePath, myArray, AnimationExportType.timelineAnimationClip);
3059-
}
3050+
// One file by animation clip
3051+
foreach (TimelineClip timeLineClip in at.GetClips()) {
3052+
string filePath = string.Format(AnimFbxFileFormat, folderPath, atObject.name, timeLineClip.displayName);
3053+
UnityEngine.Object[] myArray = new UnityEngine.Object[] { atObject, timeLineClip.animationClip };
3054+
ExportObjects (filePath, myArray, AnimationExportType.timelineAnimationClip);
3055+
}
30603056
}
30613057
}
30623058
}
@@ -3633,7 +3629,6 @@ private static void OnExport (AnimationExportType exportType = AnimationExportTy
36333629
/// Export a list of (Game) objects to FBX file.
36343630
/// Use the SaveFile panel to allow user to enter a file name.
36353631
/// <summary>
3636-
//public static string ExportObjects (string filePath, UnityEngine.Object[] objects = null, AnimationExportType exportType = AnimationExportType.all /*, bool animOnly = false*/)
36373632
public static string ExportObjects (
36383633
string filePath,
36393634
UnityEngine.Object[] objects = null,
@@ -3690,7 +3685,6 @@ public static string ExportObjects (
36903685
return null;
36913686
}
36923687

3693-
//public static string ExportObject (string filePath, UnityEngine.Object root, AnimationExportType exportType = AnimationExportType.all /*, bool animOnly = false*/)
36943688
public static string ExportObject (
36953689
string filePath, UnityEngine.Object root,
36963690
AnimationExportType exportType = AnimationExportType.all,

Assets/FbxExporters/Editor/UnitTests/ExportTimelineClipTest.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ public void ExportSingleTimelineClipTest()
3535
GameObject atObject = pd.GetGenericBinding (output.sourceObject) as GameObject;
3636
// One file by animation clip
3737
foreach (TimelineClip timeLineClip in at.GetClips()) {
38-
ModelExporter.ExportSingleTimelineClip (timeLineClip, folderPath, atObject);
39-
FileAssert.Exists (string.Format("{0}/{1}@{2}", folderPath, atObject.name, "Recorded.fbx"));
38+
var filePath = string.Format ("{0}/{1}@{2}", folderPath, atObject.name, "Recorded.fbx");
39+
ModelExporter.ExportSingleTimelineClip (timeLineClip, atObject, filePath);
40+
FileAssert.Exists (filePath);
4041
}
4142
}
4243
}

Assets/FbxExporters/Editor/UnitTests/ModelExporterTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ public void TestComponentAttributeExport()
468468

469469
var gameObject = new GameObject ();
470470
var meshFilter = gameObject.AddComponent<MeshFilter> ();
471+
gameObject.AddComponent<MeshRenderer> ();
471472

472473
meshFilter.sharedMesh = mesh;
473474

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ endif()
2323
message(STATUS "Building for ${CMAKE_BUILD_TYPE}")
2424

2525
if (NOT DEFINED PACKAGE_VERSION OR "${PACKAGE_VERSION}" STREQUAL "")
26-
set(PACKAGE_VERSION "sprint47")
26+
set(PACKAGE_VERSION "sprint48")
2727
endif()
2828
message(STATUS "Using Package Version: ${PACKAGE_VERSION}")
2929

RELEASE_NOTES.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
RELEASE NOTES
22

3+
**Version**: sprint48
4+
5+
NEW FEATURES
6+
7+
* Export Settings: Added option to export meshes without renderers
8+
9+
If selected, export meshes on GameObjects that have a mesh filter but no mesh renderer (e.g. Colliders).
10+
11+
FIXES
12+
13+
* TimelineClipExport: use EditorClip name instead of AnimationClip name for filename
14+
* TimelineClipExport: allow user to select filename for export instead of just the folder name
15+
* FbxExporter: export meshes in model prefab instances as mesh instances in fbx
16+
* FbxExporter: fix so animating spot angle in Unity animates cone angle in Maya (not penumbra)
17+
* MayaIntegration: fix so export set names don't contain invalid chars from filenames (e.g. spaces)
18+
319
**Version**: sprint47
420

521
NEW FEATURES

0 commit comments

Comments
 (0)