Skip to content

Commit 244c82e

Browse files
authored
Merge pull request #215 from Unity-Technologies/Uni-31489_Check_for_lint_code
Uni-31489 [CLEANED] Lint!
2 parents 683b1de + 818f28f commit 244c82e

File tree

6 files changed

+17
-39
lines changed

6 files changed

+17
-39
lines changed

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,11 @@ private static string TryFindDCC(string dccPath, string ext, ExportSettings.DCCT
248248
public class ExportSettings : ScriptableSingleton<ExportSettings>
249249
{
250250
public const string kDefaultSavePath = ".";
251-
private static List<string> s_PreferenceList = new List<string>() {kMayaOptionName, kMayaLtOptionName, kMaxOptionName, kBlenderOptionName };
251+
private static List<string> s_PreferenceList = new List<string>() {kMayaOptionName, kMayaLtOptionName, kMaxOptionName};
252252
//Any additional names require a space after the name
253253
public const string kMaxOptionName = "3ds Max ";
254254
public const string kMayaOptionName = "Maya ";
255255
public const string kMayaLtOptionName = "MayaLT ";
256-
public const string kBlenderOptionName = "Blender ";
257256

258257
private static string DefaultIntegrationSavePath {
259258
get{
@@ -485,7 +484,7 @@ private static int FindDCCVersion(string AppName)
485484
else
486485
{
487486
float fVersion;
488-
//In case we are looking at a Blender version- the int parse will fail so we'll need to parse it as a float.
487+
//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.
489488
if (float.TryParse(number, out fVersion))
490489
{
491490
return (int)fVersion;
@@ -699,7 +698,7 @@ static string AskMayaVersion(string exePath) {
699698

700699
// Output is like: Maya 2018, Cut Number 201706261615
701700
// We want the stuff after 'Maya ' and before the comma.
702-
// TODO: less brittle! Consider also the mel command "about -version".
701+
// (Uni-31601) less brittle! Consider also the mel command "about -version".
703702
var commaIndex = resultString.IndexOf(',');
704703
return resultString.Substring(0, commaIndex).Substring("Maya ".Length);
705704
}

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 & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,9 @@ public bool InstallMaya(bool verbose = false)
430430

431431
if (installed)
432432
{
433-
// FIXME: remove this when we support parsing existing .mod files
434-
try {
433+
// (Uni-31606): remove this when we support parsing existing .mod files
434+
try
435+
{
435436
if (verbose) { Debug.Log(string.Format("Deleting module file {0}", moduleFilePath)); }
436437
System.IO.File.Delete(moduleFilePath);
437438
installed = false;
@@ -466,15 +467,7 @@ public bool InstallMaya(bool verbose = false)
466467
{
467468
throw new NotImplementedException();
468469

469-
// TODO: parse installed .mod file
470-
471-
// TODO: if maya version not installed add
472-
473-
// TODO: else check installation path
474-
475-
// TODO: if installation path different
476-
477-
// TODO: print message package already installed else where
470+
// (Uni-31606) Parse maya mod file during installation and find location
478471
}
479472

480473
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();

0 commit comments

Comments
 (0)