Skip to content

Commit a276f08

Browse files
author
AJubrey
committed
Merge branch 'master' into Uni-31457_remove_send_to_unity_menu_item_in_Maya
# Conflicts: # Assets/Integrations/Autodesk/maya/scripts/unitySetupUI.mel
2 parents b1eb04e + cd0309f commit a276f08

File tree

10 files changed

+102
-77
lines changed

10 files changed

+102
-77
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
// ***********************************************************************
2-
// Copyright (c) 2017 Unity Technologies. All rights reserved.
3-
//
4-
// Licensed under the ##LICENSENAME##.
5-
// See LICENSE.md file in the project root for full license information.
6-
// ***********************************************************************
7-
81
using System;
92
using System.IO;
103
using UnityEditorInternal;
@@ -191,8 +184,8 @@ public override void OnInspectorGUI() {
191184
}
192185

193186
exportSettings.launchAfterInstallation = EditorGUILayout.Toggle(
194-
new GUIContent("Launch 3D Application:",
195-
"Launch the selected application after unity integration is completed."),
187+
new GUIContent("Keep 3D Application opened:",
188+
"Keep the selected 3D application open after Unity integration install has completed."),
196189
exportSettings.launchAfterInstallation
197190
);
198191

@@ -261,12 +254,17 @@ private static string TryFindDCC(string dccPath, string ext, ExportSettings.DCCT
261254
public class ExportSettings : ScriptableSingleton<ExportSettings>
262255
{
263256
public const string kDefaultSavePath = ".";
264-
private static List<string> s_PreferenceList = new List<string>() {kMayaOptionName, kMayaLtOptionName, kMaxOptionName, kBlenderOptionName };
257+
private static List<string> s_PreferenceList = new List<string>() {kMayaOptionName, kMayaLtOptionName, kMaxOptionName};
265258
//Any additional names require a space after the name
266259
public const string kMaxOptionName = "3ds Max ";
267260
public const string kMayaOptionName = "Maya ";
268261
public const string kMayaLtOptionName = "MayaLT ";
269-
public const string kBlenderOptionName = "Blender ";
262+
263+
private static string DefaultIntegrationSavePath {
264+
get{
265+
return Path.GetDirectoryName(Application.dataPath);
266+
}
267+
}
270268

271269
/// <summary>
272270
/// The paths where all the different versions of Maya are installed
@@ -343,7 +341,7 @@ protected override void LoadDefaults()
343341
HideSendToUnityMenu = true;
344342
ExportFormatSelection = 0;
345343
convertToModelSavePath = kDefaultSavePath;
346-
IntegrationSavePath = Directory.GetCurrentDirectory().ToString();
344+
IntegrationSavePath = DefaultIntegrationSavePath;
347345
dccOptionPaths = null;
348346
dccOptionNames = null;
349347
}
@@ -494,7 +492,7 @@ private static int FindDCCVersion(string AppName)
494492
else
495493
{
496494
float fVersion;
497-
//In case we are looking at a Blender version- the int parse will fail so we'll need to parse it as a float.
495+
//In case we are looking at something with a decimal based version- the int parse will fail so we'll need to parse it as a float.
498496
if (float.TryParse(number, out fVersion))
499497
{
500498
return (int)fVersion;
@@ -708,7 +706,7 @@ static string AskMayaVersion(string exePath) {
708706

709707
// Output is like: Maya 2018, Cut Number 201706261615
710708
// We want the stuff after 'Maya ' and before the comma.
711-
// TODO: less brittle! Consider also the mel command "about -version".
709+
// (Uni-31601) less brittle! Consider also the mel command "about -version".
712710
var commaIndex = resultString.IndexOf(',');
713711
return resultString.Substring(0, commaIndex).Substring("Maya ".Length);
714712
}
@@ -775,7 +773,7 @@ public static string GetIntegrationSavePath()
775773
if (string.IsNullOrEmpty(instance.IntegrationSavePath.Trim()) || !Directory.Exists(instance.IntegrationSavePath))
776774
{
777775
//The project folder, above the asset folder
778-
Directory.GetCurrentDirectory().ToString();
776+
instance.IntegrationSavePath = DefaultIntegrationSavePath;
779777
}
780778
return instance.IntegrationSavePath;
781779
}

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ void ExportComponentAttributes (MeshInfo mesh, FbxMesh fbxMesh, int[] unmergedTr
236236
// set texture coordinates per vertex
237237
FbxLayerElementArray fbxElementArray = fbxLayerElement.GetDirectArray ();
238238

239-
// TODO: only copy unique UVs into this array, and index appropriately
239+
// (Uni-31596) only copy unique UVs into this array, and index appropriately
240240
for (int n = 0; n < mesh.VertexColors.Length; n++) {
241241
// Converting to Color from Color32, as Color32 stores the colors
242242
// as ints between 0-255, while FbxColor and Color
@@ -289,7 +289,7 @@ static void ExportUVs(FbxMesh fbxMesh, MeshInfo mesh, int[] unmergedTriangles)
289289
// set texture coordinates per vertex
290290
FbxLayerElementArray fbxElementArray = fbxLayerElement.GetDirectArray ();
291291

292-
// TODO: only copy unique UVs into this array, and index appropriately
292+
// (Uni-31596) only copy unique UVs into this array, and index appropriately
293293
for (int n = 0; n < uvs[i].Length; n++) {
294294
fbxElementArray.Add (new FbxVector2 (uvs[i] [n] [0],
295295
uvs[i] [n] [1]));
@@ -1242,7 +1242,7 @@ public Vector3 [] Normals { get {
12421242
} }
12431243

12441244
/// <summary>
1245-
/// TODO: Gets the binormals for the vertices.
1245+
/// Gets the binormals for the vertices.
12461246
/// </summary>
12471247
/// <value>The normals.</value>
12481248
private Vector3[] m_Binormals;
@@ -1270,7 +1270,7 @@ public Vector3 [] Binormals {
12701270
}
12711271

12721272
/// <summary>
1273-
/// TODO: Gets the tangents for the vertices.
1273+
/// Gets the tangents for the vertices.
12741274
/// </summary>
12751275
/// <value>The tangents.</value>
12761276
private Vector4[] m_tangents;
@@ -1282,7 +1282,7 @@ public Vector4 [] Tangents { get {
12821282
} }
12831283

12841284
/// <summary>
1285-
/// TODO: Gets the vertex colors for the vertices.
1285+
/// Gets the vertex colors for the vertices.
12861286
/// </summary>
12871287
/// <value>The vertex colors.</value>
12881288
private Color32 [] m_vertexColors;

Assets/FbxExporters/Editor/FbxPrefabAutoUpdater.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -773,11 +773,11 @@ void ClassifyComponents(Transform newFbx, Transform prefab)
773773
// same node), we line up the components in the order they
774774
// appear. This never happens in stock Unity, someone must have
775775
// added an AssetPostprocessor for it to occur.
776-
// TODO: do something smarter.
776+
// (Uni-31604) Improve how the auto-updater classifies components
777777
//
778778
// If the node isn't going to be in the prefab, we don't care
779779
// about what components might be on it.
780-
foreach(var name in m_nodesInUpdatedPrefab)
780+
foreach (var name in m_nodesInUpdatedPrefab)
781781
{
782782
if (!m_new.HasNode(name)) {
783783
// It's not in the FBX, so clearly we're not updating any components.
@@ -794,18 +794,12 @@ void ClassifyComponents(Transform newFbx, Transform prefab)
794794
List<string> prefabValues = null; // get them only if we need them.
795795

796796
// If we have multiple identical-type components, match them up by index.
797-
// TODO: match them up to minimize the diff instead.
798797
int oldN = oldValues.Count;
799798
int newN = newValues.Count;
800799
for(int i = 0, n = System.Math.Max(oldN, newN); i < n; ++i) {
801800
if (/* isNew */ i < newN) {
802801
var newValue = newValues[i];
803-
804-
// Special case on Transform: if we reparented
805-
// this node then always update the transform
806-
// (UNI-25526). That's because when we do the
807-
// reparenting, it changes the 'prefabValue' in
808-
// a complicated way.
802+
809803
var isReparentedTransform = (typename == "UnityEngine.Transform"
810804
&& m_reparentings.ContainsKey(name));
811805

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
// ***********************************************************************
2-
// Copyright (c) 2017 Unity Technologies. All rights reserved.
3-
//
4-
// Licensed under the ##LICENSENAME##.
5-
// See LICENSE.md file in the project root for full license information.
6-
// ***********************************************************************
7-
81
using UnityEngine;
92
using UnityEditor;
103
using System;
@@ -442,8 +435,9 @@ public bool InstallMaya(bool verbose = false)
442435

443436
if (installed)
444437
{
445-
// FIXME: remove this when we support parsing existing .mod files
446-
try {
438+
// (Uni-31606): remove this when we support parsing existing .mod files
439+
try
440+
{
447441
if (verbose) { Debug.Log(string.Format("Deleting module file {0}", moduleFilePath)); }
448442
System.IO.File.Delete(moduleFilePath);
449443
installed = false;
@@ -478,15 +472,7 @@ public bool InstallMaya(bool verbose = false)
478472
{
479473
throw new NotImplementedException();
480474

481-
// TODO: parse installed .mod file
482-
483-
// TODO: if maya version not installed add
484-
485-
// TODO: else check installation path
486-
487-
// TODO: if installation path different
488-
489-
// TODO: print message package already installed else where
475+
// (Uni-31606) Parse maya mod file during installation and find location
490476
}
491477

492478
return SetupUserStartupScript (verbose);

Assets/FbxExporters/Editor/ReviewLastSavedModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public static void LastSavedModel ()
189189
System.Collections.Generic.List<UnityEngine.SceneManagement.Scene> scenes
190190
= new System.Collections.Generic.List<UnityEngine.SceneManagement.Scene> ();
191191

192-
string desiredSceneName = "";//FbxExporters.EditorTools.ExportSettings.GetTurnTableSceneName ();
192+
string desiredSceneName = "";
193193
if (string.IsNullOrEmpty (desiredSceneName)) {
194194
desiredSceneName = DefaultSceneName;
195195
}
@@ -212,7 +212,7 @@ public static void LastSavedModel ()
212212
// if turntable scene not added to list of scenes
213213
if (!scene.IsValid () || !scene.isLoaded)
214214
{
215-
string scenePath = "";//FbxExporters.EditorTools.ExportSettings.GetTurnTableScenePath ();
215+
string scenePath = "";
216216
if (string.IsNullOrEmpty(scenePath)) {
217217
// and if for some reason the turntable scene is missing create an empty scene
218218
// NOTE: we cannot use NewScene because it will force me to save the modified Untitled scene

Assets/FbxExporters/Editor/UnitTests/FbxExportSettingsTest.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ public void TestFindPreferredProgram()
189189
testList.Add(ExportSettings.GetUniqueDCCOptionName(ExportSettings.kMayaOptionName + "2016"));
190190
testList.Add(ExportSettings.GetUniqueDCCOptionName(ExportSettings.kMayaOptionName + "2017"));
191191
testList.Add(ExportSettings.GetUniqueDCCOptionName(ExportSettings.kMaxOptionName + "2017"));
192-
testList.Add(ExportSettings.GetUniqueDCCOptionName(ExportSettings.kBlenderOptionName + "2.67"));
193192
testList.Add(ExportSettings.GetUniqueDCCOptionName(""));
194193
testList.Add(ExportSettings.GetUniqueDCCOptionName(null));
195194
testList.Add(ExportSettings.GetUniqueDCCOptionName(ExportSettings.kMayaLtOptionName));
@@ -201,13 +200,6 @@ public void TestFindPreferredProgram()
201200
//While Maya 2017 and 3ds Max 2017 are tied for most recent, Maya 2017 should win because we prefer Maya.
202201
Assert.AreEqual(preferred, 9);
203202

204-
List<string> blenderList = new List<string> { "Blender 2.67", "Blender 3.0" };
205-
ExportSettings.instance.SetDCCOptionNames(blenderList);
206-
207-
preferred = ExportSettings.instance.GetPreferredDCCApp();
208-
//The function should be able to deal with floats well enough to give us a preferred version of soemthing like blender, which does not use the year.
209-
Assert.AreEqual(preferred, 1);
210-
211203
ExportSettings.instance.ClearDCCOptionNames();
212204
//Try running it with an empty list
213205
preferred = ExportSettings.instance.GetPreferredDCCApp();

Assets/Integrations/Autodesk/max/scripts/UnityFbxForMaxPlugin.ms

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- MacroScripts that will perform actions
2-
macroScript UnityImport category:"Unity" tooltip:"Import FBX file from Unity project and auto-configure for exporting."
2+
macroScript UnityImport category:"Unity" tooltip:"Import an FBX file from a Unity project and auto-configure for exporting"
33
(
44
origObjects = #()
55

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

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,68 @@ global string $unityExportIconPath = "export.png";
88
global string $unityIconPath = "unity.png";
99

1010
global string $unityFamilyLabel = "The UnityFbxForMaya plugin allows you to reliably exchange and review your work between Maya and Unity.";
11-
global string $unityImportLabel = "Import FBX file from Unity Project and auto-configure for exporting";
11+
global string $unityImportLabel = "Import an FBX file from a Unity project and auto-configure for exporting";
1212
global string $unityExportLabel = "Export Model to Unity";
1313

14+
global string $unityCommandsFile = "unityCommands.mel";
15+
global string $unityImportMenuName = "Import";
16+
global string $unityExportMenuName = "Export";
17+
global string $unityImportCommand = "unityImport";
18+
global string $unityExportCommand = "unityExport";
1419
global string $unityRemoveSendToUnityMenuOption = "UnityFbxForMaya_removeSendToUnityMenu";
1520
global string $unitySendToUnityMenuName = "sendToUnityMenu";
1621

17-
1822
global proc string unityWhatsNewVersion(){
1923
return `about -q -version`;
2024

2125
}
2226

2327
global proc unitySetupUI(){
24-
2528
global string $removeOtherMenuString;
2629
global string $unitySendToUnityMenuName;
2730

2831
$isHeadless = `optionVar -q "UnityFbxForMaya_Headless"`;
2932
if($isHeadless){
3033
// headless install, don't add UI
3134
return;
32-
}
35+
}
36+
37+
evalDeferred -lowestPriority "unityInstallUI";
38+
}
39+
40+
global proc unityInstallUI(){
41+
global string $unityMenuName;
42+
global string $unityMenuDivider;
43+
global string $unityMenuLabel;
44+
global string $unityMenuInsertAfter;
45+
46+
global string $unityImportIconPath;
47+
global string $unityExportIconPath;
48+
global string $unityIconPath;
49+
50+
global string $unityFamilyLabel;
51+
global string $unityImportLabel;
52+
global string $unityExportLabel;
53+
global string $unityCommandsFile;
54+
global string $unityImportMenuName;
55+
global string $unityExportMenuName;
56+
global string $unityImportCommand;
57+
global string $unityExportCommand;
3358

34-
evalDeferred -lowestPriority "buildFileMenu; \
35-
\
36-
$removeOtherMenu = `optionVar -q $unityRemoveSendToUnityMenuOption`;\
37-
if($removeOtherMenu){\
38-
menu -e -visible false $unitySendToUnityMenuName;\
39-
}\
40-
\
41-
$parentMenu = $gMainFileMenu; \
42-
$pluginVersion = unityWhatsNewVersion(); \
43-
source \"unityCommands.mel\"; \
44-
menuItem -parent $parentMenu -insertAfter $unityMenuInsertAfter -divider true -longDivider false -version $pluginVersion $unityMenuDivider; \
45-
menuItem -parent $parentMenu -insertAfter $unityMenuDivider -subMenu true -label $unityMenuLabel -tearOff true -version $pluginVersion -image $unityIconPath -annotation $unityFamilyLabel $unityMenuName; \
46-
menuItem -parent $unityMenuName -label \"Import\" -version $pluginVersion -image $unityImportIconPath -annotation $unityImportLabel -command \"unityImport\"; \
47-
menuItem -parent $unityMenuName -label \"Export\" -version $pluginVersion -image $unityExportIconPath -annotation $unityExportLabel -command \"unityExport\";";
59+
global string $gMainFileMenu;
60+
61+
buildFileMenu;
62+
$parentMenu = $gMainFileMenu;
63+
$pluginVersion = unityWhatsNewVersion();
64+
eval ("source " + $unityCommandsFile);
65+
menuItem -parent $parentMenu -insertAfter $unityMenuInsertAfter -divider true -longDivider false -version $pluginVersion $unityMenuDivider;
66+
menuItem -parent $parentMenu -insertAfter $unityMenuDivider -subMenu true -label $unityMenuLabel -tearOff true -version $pluginVersion -image $unityIconPath -annotation $unityFamilyLabel $unityMenuName;
67+
menuItem -parent $unityMenuName -label $unityImportMenuName -version $pluginVersion -image $unityImportIconPath -annotation $unityImportLabel -command $unityImportCommand;
68+
menuItem -parent $unityMenuName -label $unityExportMenuName -version $pluginVersion -image $unityExportIconPath -annotation $unityExportLabel -command $unityExportCommand;
69+
70+
$removeOtherMenu = `optionVar -q $unityRemoveSendToUnityMenuOption`;
71+
if($removeOtherMenu){
72+
menu -e -visible false $unitySendToUnityMenuName;
73+
}
74+
4875
}

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 "1.1.0b1")
26+
set(PACKAGE_VERSION "sprint34")
2727
endif()
2828
message(STATUS "Using Package Version: ${PACKAGE_VERSION}")
2929

RELEASE_NOTES.md

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

3+
**Version**: sprint34
4+
5+
NEW FEATURES
6+
7+
* Ship all C# scripts as source code
8+
9+
* Added Maya LT Integration
10+
11+
Replaced Maya python implementation with MEL script, which is used by both Maya and Maya LT.
12+
13+
NOTE: it is no longer possible to unload the plugin using Maya's plugin manager.
14+
15+
* Export Settings: Added option to launch 3D application after installing integration
16+
17+
* Export Settings: Added option to export FBX as ASCII or Binary
18+
19+
* Export Settings: Added integration unzip location field
20+
21+
Use new field to select where to unzip the integration zip file, instead of being asked each time
22+
"Install Unity Integration" button is clicked.
23+
24+
FIXES
25+
* Export Settings: Moved "Browse" button out of the dropdown
26+
* Unity 3ds Max Integration: Added tooltips to the import/export menu items
27+
* Export Settings: Align checkboxes, text fields, and dropdown
28+
* Fbx Prefab: Add tooltip to "Source Fbx Asset" field
29+
* Export Settings: Search for 3D applicaitons in multiple vendor locations (e.g. C:/ and D:/ drive)
30+
331
**Version**: 1.1.0b1
432

533
NEW FEATURES

0 commit comments

Comments
 (0)