Skip to content

Commit 28dbe65

Browse files
committed
code review fixes
- add comment to GetMayaInstructionPath() - use !modelGO instead of modelGO == null - add tests for getting the maya instruction path
1 parent cc97aab commit 28dbe65

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Assets/FbxExporters/Editor/InstallIntegration.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ public static string GetTempSavePath()
254254
return FbxExporters.Review.TurnTable.TempSavePath.Replace("\\", "/");
255255
}
256256

257+
/// <summary>
258+
/// Gets the maya instruction path relative to the Assets folder.
259+
/// Assets folder is not included in the path.
260+
/// </summary>
261+
/// <returns>The relative maya instruction path.</returns>
257262
public static string GetMayaInstructionPath()
258263
{
259264
return MAYA_INSTRUCTION_FILENAME;

Assets/FbxExporters/Editor/ReviewLastSavedModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private static Bounds GetRendererBounds(GameObject modelGO)
138138

139139
private static void FrameCameraOnModel(GameObject modelGO)
140140
{
141-
if (modelGO == null) {
141+
if (!modelGO) {
142142
return;
143143
}
144144

@@ -175,11 +175,11 @@ private static void LoadLastSavedModel ()
175175
}
176176

177177
// focus onto model
178-
if (LastModel != null) {
178+
if (LastModel) {
179179
var model = LastModel as GameObject;
180-
if (model != null) {
180+
if (model) {
181181
var turntable = model.transform.parent;
182-
if (turntable != null) {
182+
if (turntable) {
183183
var turntableGO = turntable.gameObject;
184184
UnityEditor.Selection.objects = new GameObject[]{ turntableGO };
185185
FrameCameraOnModel (turntableGO);

Assets/FbxExporters/Editor/UnitTests/IntegrationsTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public void BasicTest() {
4949
LogNonEmptyString("package version", Editor.Integrations.GetPackageVersion());
5050
LogNonEmptyString("temp path", Editor.Integrations.GetTempSavePath());
5151
LogNonEmptyString("export settings path", Editor.Integrations.GetExportSettingsPath ());
52+
LogNonEmptyString ("instruction path", Editor.Integrations.GetMayaInstructionPath ());
53+
LogNonEmptyString ("full instruction path", Editor.Integrations.GetFullMayaInstructionPath ());
5254

5355
// test that the paths don't contain backslashes
5456
Assert.IsFalse(Editor.Integrations.GetAppPath().Contains("\\"));

0 commit comments

Comments
 (0)