diff --git a/tools/nitpick/src/AWSInterface.cpp b/tools/nitpick/src/AWSInterface.cpp index a098d17917..19697d51dc 100644 --- a/tools/nitpick/src/AWSInterface.cpp +++ b/tools/nitpick/src/AWSInterface.cpp @@ -8,6 +8,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "AWSInterface.h" +#include "common.h" #include #include @@ -29,7 +30,9 @@ void AWSInterface::createWebPageFromResults(const QString& testResults, QCheckBox* updateAWSCheckBox, QRadioButton* diffImageRadioButton, QRadioButton* ssimImageRadionButton, - QLineEdit* urlLineEdit + QLineEdit* urlLineEdit, + const QString& branch, + const QString& user ) { _workingDirectory = workingDirectory; @@ -53,6 +56,9 @@ void AWSInterface::createWebPageFromResults(const QString& testResults, _urlLineEdit = urlLineEdit; _urlLineEdit->setEnabled(false); + _branch = branch; + _user = user; + QString zipFilenameWithoutExtension = zipFilename.split('.')[0]; extractTestFailuresFromZippedFolder(_workingDirectory + "/" + zipFilenameWithoutExtension); @@ -202,13 +208,21 @@ void AWSInterface::writeTitle(QTextStream& stream, const QStringList& originalNa stream << "run on " << hostName << "\n"; - int numberOfFailures = originalNamesFailures.length(); - int numberOfSuccesses = originalNamesSuccesses.length(); + stream << "

"; + stream << "nitpick " << nitpickVersion; + stream << ", tests from GitHub: " << _user << "/" << _branch; + stream << "

"; - stream << "

" << QString::number(numberOfFailures) << " failed, out of a total of " << QString::number(numberOfSuccesses) << " tests

\n"; + _numberOfFailures = originalNamesFailures.length(); + _numberOfSuccesses = originalNamesSuccesses.length(); + + stream << "

" << QString::number(_numberOfFailures) << " failed, out of a total of " << QString::number(_numberOfFailures + _numberOfSuccesses) << " tests

\n"; stream << "\t" << "\t" << "\n"; - stream << "\t" << "\t" << "

The following tests failed:

"; + + if (_numberOfFailures > 0) { + stream << "\t" << "\t" << "

The following tests failed:

"; + } } void AWSInterface::writeTable(QTextStream& stream, const QStringList& originalNamesFailures, const QStringList& originalNamesSuccesses) { @@ -289,7 +303,10 @@ void AWSInterface::writeTable(QTextStream& stream, const QStringList& originalNa closeTable(stream); stream << "\t" << "\t" << "\n"; - stream << "\t" << "\t" << "

The following tests passed:

"; + + if (_numberOfSuccesses > 0) { + stream << "\t" << "\t" << "

The following tests passed:

"; + } // Now do the same for passes folderNames.clear(); diff --git a/tools/nitpick/src/AWSInterface.h b/tools/nitpick/src/AWSInterface.h index 77d500fa7c..a2e4e36c37 100644 --- a/tools/nitpick/src/AWSInterface.h +++ b/tools/nitpick/src/AWSInterface.h @@ -31,7 +31,10 @@ public: QCheckBox* updateAWSCheckBox, QRadioButton* diffImageRadioButton, QRadioButton* ssimImageRadionButton, - QLineEdit* urlLineEdit); + QLineEdit* urlLineEdit, + const QString& branch, + const QString& user + ); void extractTestFailuresFromZippedFolder(const QString& folderName); void createHTMLFile(); @@ -70,9 +73,13 @@ private: QString AWS_BUCKET{ "hifi-qa" }; QLineEdit* _urlLineEdit; - + QString _user; + QString _branch; QString _comparisonImageFilename; + + int _numberOfFailures; + int _numberOfSuccesses; }; #endif // hifi_AWSInterface_h \ No newline at end of file diff --git a/tools/nitpick/src/Nitpick.cpp b/tools/nitpick/src/Nitpick.cpp index e6894ee883..02ed120350 100644 --- a/tools/nitpick/src/Nitpick.cpp +++ b/tools/nitpick/src/Nitpick.cpp @@ -266,7 +266,7 @@ void Nitpick::on_createXMLScriptRadioButton_clicked() { } void Nitpick::on_createWebPagePushbutton_clicked() { - _testCreator->createWebPage(_ui.updateAWSCheckBox, _ui.diffImageRadioButton, _ui.ssimImageRadioButton, _ui.awsURLLineEdit); + _testCreator->createWebPage(_ui.updateAWSCheckBox, _ui.diffImageRadioButton, _ui.ssimImageRadioButton, _ui.awsURLLineEdit, _ui.branchLineEdit->text(), _ui.userLineEdit->text()); } void Nitpick::about() { diff --git a/tools/nitpick/src/TestCreator.cpp b/tools/nitpick/src/TestCreator.cpp index 587490bb64..1e5b15360f 100644 --- a/tools/nitpick/src/TestCreator.cpp +++ b/tools/nitpick/src/TestCreator.cpp @@ -1118,7 +1118,10 @@ void TestCreator::createWebPage( QCheckBox* updateAWSCheckBox, QRadioButton* diffImageRadioButton, QRadioButton* ssimImageRadionButton, - QLineEdit* urlLineEdit + QLineEdit* urlLineEdit, + const QString& branch, + const QString& user + ) { QString testResults = QFileDialog::getOpenFileName(nullptr, "Please select the zipped test results to update from", nullptr, "Zipped TestCreator Results (TestResults--*.zip)"); @@ -1142,6 +1145,8 @@ void TestCreator::createWebPage( updateAWSCheckBox, diffImageRadioButton, ssimImageRadionButton, - urlLineEdit + urlLineEdit, + branch, + user ); } \ No newline at end of file diff --git a/tools/nitpick/src/TestCreator.h b/tools/nitpick/src/TestCreator.h index b4ce56a7d5..e708529ba4 100644 --- a/tools/nitpick/src/TestCreator.h +++ b/tools/nitpick/src/TestCreator.h @@ -107,7 +107,10 @@ public: QCheckBox* updateAWSCheckBox, QRadioButton* diffImageRadioButton, QRadioButton* ssimImageRadionButton, - QLineEdit* urlLineEdit); + QLineEdit* urlLineEdit, + const QString& branch, + const QString& user + ); private: QProgressBar* _progressBar; diff --git a/tools/nitpick/ui/Nitpick.ui b/tools/nitpick/ui/Nitpick.ui index c85311d86b..e1d7699f22 100644 --- a/tools/nitpick/ui/Nitpick.ui +++ b/tools/nitpick/ui/Nitpick.ui @@ -620,7 +620,7 @@ <html><head/><body><p>If unchecked, will not show results during evaluation</p></body></html> - usePreviousInstallation + Use Previous Installation false @@ -895,7 +895,7 @@ <html><head/><body><p>If unchecked, will not show results during evaluation</p></body></html> - usePreviousInstallation + Use Previous Installation false diff --git a/tools/unity-avatar-exporter/Assets/Editor/AvatarExporter/AvatarExporter.cs b/tools/unity-avatar-exporter/Assets/Editor/AvatarExporter/AvatarExporter.cs index 87f401d478..11d83a52e8 100644 --- a/tools/unity-avatar-exporter/Assets/Editor/AvatarExporter/AvatarExporter.cs +++ b/tools/unity-avatar-exporter/Assets/Editor/AvatarExporter/AvatarExporter.cs @@ -17,7 +17,7 @@ using System.Text.RegularExpressions; class AvatarExporter : MonoBehaviour { // update version number for every PR that changes this file, also set updated version in README file - static readonly string AVATAR_EXPORTER_VERSION = "0.3.6"; + static readonly string AVATAR_EXPORTER_VERSION = "0.3.7"; static readonly float HIPS_GROUND_MIN_Y = 0.01f; static readonly float HIPS_SPINE_CHEST_MIN_SEPARATION = 0.001f; @@ -332,8 +332,7 @@ class AvatarExporter : MonoBehaviour { static List alternateStandardShaderMaterials = new List(); static List unsupportedShaderMaterials = new List(); - static Scene previewScene; - static string previousScene = ""; + static SceneSetup[] previousSceneSetup; static Vector3 previousScenePivot = Vector3.zero; static Quaternion previousSceneRotation = Quaternion.identity; static float previousSceneSize = 0.0f; @@ -1223,14 +1222,22 @@ class AvatarExporter : MonoBehaviour { } static bool OpenPreviewScene() { + // store the current scene setup to restore when closing the preview scene + previousSceneSetup = EditorSceneManager.GetSceneManagerSetup(); + + // if the user is currently in the Humanoid Avatar Configuration then inform them to close it first + if (EditorSceneManager.GetActiveScene().name == "Avatar Configuration" && previousSceneSetup.Length == 0) { + EditorUtility.DisplayDialog("Error", "Please exit the Avatar Configuration before exporting.", "Ok"); + return false; + } + // see if the user wants to save their current scene before opening preview avatar scene in place of user's scene if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo()) { return false; } - // store the user's current scene to re-open when done and open a new default scene in place of the user's scene - previousScene = EditorSceneManager.GetActiveScene().path; - previewScene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene); + // open a new empty scene in place of the user's scene + EditorSceneManager.NewScene(NewSceneSetup.EmptyScene); // instantiate a game object to preview the avatar and a game object for the height reference prefab at 0, 0, 0 UnityEngine.Object heightReferenceResource = AssetDatabase.LoadAssetAtPath(HEIGHT_REFERENCE_PREFAB, typeof(UnityEngine.Object)); @@ -1259,13 +1266,8 @@ class AvatarExporter : MonoBehaviour { DestroyImmediate(avatarPreviewObject); DestroyImmediate(heightReferenceObject); - // re-open the scene the user had open before switching to the preview scene - if (!string.IsNullOrEmpty(previousScene)) { - EditorSceneManager.OpenScene(previousScene); - } - - // close the preview scene and flag it to be removed - EditorSceneManager.CloseScene(previewScene, true); + // restore to the previous scene setup that the user had open before exporting + EditorSceneManager.RestoreSceneManagerSetup(previousSceneSetup); // restore the camera pivot and rotation to the user's previous scene settings var sceneView = SceneView.lastActiveSceneView; diff --git a/tools/unity-avatar-exporter/Assets/Editor/AvatarExporter/HeightReference.prefab b/tools/unity-avatar-exporter/Assets/Editor/AvatarExporter/HeightReference.prefab index 3a6b6b21fa..4464617387 100644 --- a/tools/unity-avatar-exporter/Assets/Editor/AvatarExporter/HeightReference.prefab +++ b/tools/unity-avatar-exporter/Assets/Editor/AvatarExporter/HeightReference.prefab @@ -599,7 +599,7 @@ MeshRenderer: m_ReflectionProbeUsage: 1 m_RenderingLayerMask: 4294967295 m_Materials: - - {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2} + - {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -774,7 +774,7 @@ MeshRenderer: m_ReflectionProbeUsage: 1 m_RenderingLayerMask: 4294967295 m_Materials: - - {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2} + - {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -809,7 +809,7 @@ MeshRenderer: m_ReflectionProbeUsage: 1 m_RenderingLayerMask: 4294967295 m_Materials: - - {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2} + - {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -844,7 +844,7 @@ MeshRenderer: m_ReflectionProbeUsage: 1 m_RenderingLayerMask: 4294967295 m_Materials: - - {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2} + - {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 @@ -879,7 +879,7 @@ MeshRenderer: m_ReflectionProbeUsage: 1 m_RenderingLayerMask: 4294967295 m_Materials: - - {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2} + - {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 diff --git a/tools/unity-avatar-exporter/Assets/README.txt b/tools/unity-avatar-exporter/Assets/README.txt index 5b228ebf75..0b5cb49117 100644 --- a/tools/unity-avatar-exporter/Assets/README.txt +++ b/tools/unity-avatar-exporter/Assets/README.txt @@ -1,8 +1,8 @@ High Fidelity, Inc. Avatar Exporter -Version 0.3.6 +Version 0.3.7 -Note: It is recommended to use Unity versions between 2017.4.17f1 and 2018.2.12f1 for this Avatar Exporter. +Note: It is recommended to use Unity versions between 2017.4.15f1 and 2018.2.12f1 for this Avatar Exporter. To create a new avatar project: 1. Import your .fbx avatar model into your Unity project's Assets by either dragging and dropping the file into the Assets window or by using Assets menu > Import New Assets. diff --git a/tools/unity-avatar-exporter/avatarExporter.unitypackage b/tools/unity-avatar-exporter/avatarExporter.unitypackage index 05ad49baa6..d906cfc0a4 100644 Binary files a/tools/unity-avatar-exporter/avatarExporter.unitypackage and b/tools/unity-avatar-exporter/avatarExporter.unitypackage differ