Merge branch 'master' of github.com:highfidelity/hifi into 21660-updateNitpickForQuest

This commit is contained in:
NissimHadar 2019-03-22 11:24:18 -07:00
commit a8dba041a2
10 changed files with 68 additions and 34 deletions

View file

@ -8,6 +8,7 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
// //
#include "AWSInterface.h" #include "AWSInterface.h"
#include "common.h"
#include <QDirIterator> #include <QDirIterator>
#include <QJsonDocument> #include <QJsonDocument>
@ -29,7 +30,9 @@ void AWSInterface::createWebPageFromResults(const QString& testResults,
QCheckBox* updateAWSCheckBox, QCheckBox* updateAWSCheckBox,
QRadioButton* diffImageRadioButton, QRadioButton* diffImageRadioButton,
QRadioButton* ssimImageRadionButton, QRadioButton* ssimImageRadionButton,
QLineEdit* urlLineEdit QLineEdit* urlLineEdit,
const QString& branch,
const QString& user
) { ) {
_workingDirectory = workingDirectory; _workingDirectory = workingDirectory;
@ -53,6 +56,9 @@ void AWSInterface::createWebPageFromResults(const QString& testResults,
_urlLineEdit = urlLineEdit; _urlLineEdit = urlLineEdit;
_urlLineEdit->setEnabled(false); _urlLineEdit->setEnabled(false);
_branch = branch;
_user = user;
QString zipFilenameWithoutExtension = zipFilename.split('.')[0]; QString zipFilenameWithoutExtension = zipFilename.split('.')[0];
extractTestFailuresFromZippedFolder(_workingDirectory + "/" + zipFilenameWithoutExtension); extractTestFailuresFromZippedFolder(_workingDirectory + "/" + zipFilenameWithoutExtension);
@ -202,14 +208,22 @@ void AWSInterface::writeTitle(QTextStream& stream, const QStringList& originalNa
stream << "run on " << hostName << "</h1>\n"; stream << "run on " << hostName << "</h1>\n";
int numberOfFailures = originalNamesFailures.length(); stream << "<h2>";
int numberOfSuccesses = originalNamesSuccesses.length(); stream << "nitpick " << nitpickVersion;
stream << ", tests from GitHub: " << _user << "/" << _branch;
stream << "</h2>";
stream << "<h2>" << QString::number(numberOfFailures) << " failed, out of a total of " << QString::number(numberOfSuccesses) << " tests</h2>\n"; _numberOfFailures = originalNamesFailures.length();
_numberOfSuccesses = originalNamesSuccesses.length();
stream << "<h2>" << QString::number(_numberOfFailures) << " failed, out of a total of " << QString::number(_numberOfFailures + _numberOfSuccesses) << " tests</h2>\n";
stream << "\t" << "\t" << "<font color=\"red\">\n"; stream << "\t" << "\t" << "<font color=\"red\">\n";
if (_numberOfFailures > 0) {
stream << "\t" << "\t" << "<h1>The following tests failed:</h1>"; stream << "\t" << "\t" << "<h1>The following tests failed:</h1>";
} }
}
void AWSInterface::writeTable(QTextStream& stream, const QStringList& originalNamesFailures, const QStringList& originalNamesSuccesses) { void AWSInterface::writeTable(QTextStream& stream, const QStringList& originalNamesFailures, const QStringList& originalNamesSuccesses) {
QString previousTestName{ "" }; QString previousTestName{ "" };
@ -289,7 +303,10 @@ void AWSInterface::writeTable(QTextStream& stream, const QStringList& originalNa
closeTable(stream); closeTable(stream);
stream << "\t" << "\t" << "<font color=\"blue\">\n"; stream << "\t" << "\t" << "<font color=\"blue\">\n";
if (_numberOfSuccesses > 0) {
stream << "\t" << "\t" << "<h1>The following tests passed:</h1>"; stream << "\t" << "\t" << "<h1>The following tests passed:</h1>";
}
// Now do the same for passes // Now do the same for passes
folderNames.clear(); folderNames.clear();

View file

@ -31,7 +31,10 @@ public:
QCheckBox* updateAWSCheckBox, QCheckBox* updateAWSCheckBox,
QRadioButton* diffImageRadioButton, QRadioButton* diffImageRadioButton,
QRadioButton* ssimImageRadionButton, QRadioButton* ssimImageRadionButton,
QLineEdit* urlLineEdit); QLineEdit* urlLineEdit,
const QString& branch,
const QString& user
);
void extractTestFailuresFromZippedFolder(const QString& folderName); void extractTestFailuresFromZippedFolder(const QString& folderName);
void createHTMLFile(); void createHTMLFile();
@ -70,9 +73,13 @@ private:
QString AWS_BUCKET{ "hifi-qa" }; QString AWS_BUCKET{ "hifi-qa" };
QLineEdit* _urlLineEdit; QLineEdit* _urlLineEdit;
QString _user;
QString _branch;
QString _comparisonImageFilename; QString _comparisonImageFilename;
int _numberOfFailures;
int _numberOfSuccesses;
}; };
#endif // hifi_AWSInterface_h #endif // hifi_AWSInterface_h

View file

@ -266,7 +266,7 @@ void Nitpick::on_createXMLScriptRadioButton_clicked() {
} }
void Nitpick::on_createWebPagePushbutton_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() { void Nitpick::about() {

View file

@ -1118,7 +1118,10 @@ void TestCreator::createWebPage(
QCheckBox* updateAWSCheckBox, QCheckBox* updateAWSCheckBox,
QRadioButton* diffImageRadioButton, QRadioButton* diffImageRadioButton,
QRadioButton* ssimImageRadionButton, 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, QString testResults = QFileDialog::getOpenFileName(nullptr, "Please select the zipped test results to update from", nullptr,
"Zipped TestCreator Results (TestResults--*.zip)"); "Zipped TestCreator Results (TestResults--*.zip)");
@ -1142,6 +1145,8 @@ void TestCreator::createWebPage(
updateAWSCheckBox, updateAWSCheckBox,
diffImageRadioButton, diffImageRadioButton,
ssimImageRadionButton, ssimImageRadionButton,
urlLineEdit urlLineEdit,
branch,
user
); );
} }

View file

@ -107,7 +107,10 @@ public:
QCheckBox* updateAWSCheckBox, QCheckBox* updateAWSCheckBox,
QRadioButton* diffImageRadioButton, QRadioButton* diffImageRadioButton,
QRadioButton* ssimImageRadionButton, QRadioButton* ssimImageRadionButton,
QLineEdit* urlLineEdit); QLineEdit* urlLineEdit,
const QString& branch,
const QString& user
);
private: private:
QProgressBar* _progressBar; QProgressBar* _progressBar;

View file

@ -620,7 +620,7 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If unchecked, will not show results during evaluation&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If unchecked, will not show results during evaluation&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="text"> <property name="text">
<string>usePreviousInstallation</string> <string>Use Previous Installation</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>
@ -895,7 +895,7 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If unchecked, will not show results during evaluation&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If unchecked, will not show results during evaluation&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="text"> <property name="text">
<string>usePreviousInstallation</string> <string>Use Previous Installation</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>

View file

@ -17,7 +17,7 @@ using System.Text.RegularExpressions;
class AvatarExporter : MonoBehaviour { class AvatarExporter : MonoBehaviour {
// update version number for every PR that changes this file, also set updated version in README file // 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_GROUND_MIN_Y = 0.01f;
static readonly float HIPS_SPINE_CHEST_MIN_SEPARATION = 0.001f; static readonly float HIPS_SPINE_CHEST_MIN_SEPARATION = 0.001f;
@ -332,8 +332,7 @@ class AvatarExporter : MonoBehaviour {
static List<string> alternateStandardShaderMaterials = new List<string>(); static List<string> alternateStandardShaderMaterials = new List<string>();
static List<string> unsupportedShaderMaterials = new List<string>(); static List<string> unsupportedShaderMaterials = new List<string>();
static Scene previewScene; static SceneSetup[] previousSceneSetup;
static string previousScene = "";
static Vector3 previousScenePivot = Vector3.zero; static Vector3 previousScenePivot = Vector3.zero;
static Quaternion previousSceneRotation = Quaternion.identity; static Quaternion previousSceneRotation = Quaternion.identity;
static float previousSceneSize = 0.0f; static float previousSceneSize = 0.0f;
@ -1223,14 +1222,22 @@ class AvatarExporter : MonoBehaviour {
} }
static bool OpenPreviewScene() { 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 // see if the user wants to save their current scene before opening preview avatar scene in place of user's scene
if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo()) { if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo()) {
return false; 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 // open a new empty scene in place of the user's scene
previousScene = EditorSceneManager.GetActiveScene().path; EditorSceneManager.NewScene(NewSceneSetup.EmptyScene);
previewScene = 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 // 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)); UnityEngine.Object heightReferenceResource = AssetDatabase.LoadAssetAtPath(HEIGHT_REFERENCE_PREFAB, typeof(UnityEngine.Object));
@ -1259,13 +1266,8 @@ class AvatarExporter : MonoBehaviour {
DestroyImmediate(avatarPreviewObject); DestroyImmediate(avatarPreviewObject);
DestroyImmediate(heightReferenceObject); DestroyImmediate(heightReferenceObject);
// re-open the scene the user had open before switching to the preview scene // restore to the previous scene setup that the user had open before exporting
if (!string.IsNullOrEmpty(previousScene)) { EditorSceneManager.RestoreSceneManagerSetup(previousSceneSetup);
EditorSceneManager.OpenScene(previousScene);
}
// close the preview scene and flag it to be removed
EditorSceneManager.CloseScene(previewScene, true);
// restore the camera pivot and rotation to the user's previous scene settings // restore the camera pivot and rotation to the user's previous scene settings
var sceneView = SceneView.lastActiveSceneView; var sceneView = SceneView.lastActiveSceneView;

View file

@ -599,7 +599,7 @@ MeshRenderer:
m_ReflectionProbeUsage: 1 m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295 m_RenderingLayerMask: 4294967295
m_Materials: m_Materials:
- {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2} - {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2}
m_StaticBatchInfo: m_StaticBatchInfo:
firstSubMesh: 0 firstSubMesh: 0
subMeshCount: 0 subMeshCount: 0
@ -774,7 +774,7 @@ MeshRenderer:
m_ReflectionProbeUsage: 1 m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295 m_RenderingLayerMask: 4294967295
m_Materials: m_Materials:
- {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2} - {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2}
m_StaticBatchInfo: m_StaticBatchInfo:
firstSubMesh: 0 firstSubMesh: 0
subMeshCount: 0 subMeshCount: 0
@ -809,7 +809,7 @@ MeshRenderer:
m_ReflectionProbeUsage: 1 m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295 m_RenderingLayerMask: 4294967295
m_Materials: m_Materials:
- {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2} - {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2}
m_StaticBatchInfo: m_StaticBatchInfo:
firstSubMesh: 0 firstSubMesh: 0
subMeshCount: 0 subMeshCount: 0
@ -844,7 +844,7 @@ MeshRenderer:
m_ReflectionProbeUsage: 1 m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295 m_RenderingLayerMask: 4294967295
m_Materials: m_Materials:
- {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2} - {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2}
m_StaticBatchInfo: m_StaticBatchInfo:
firstSubMesh: 0 firstSubMesh: 0
subMeshCount: 0 subMeshCount: 0
@ -879,7 +879,7 @@ MeshRenderer:
m_ReflectionProbeUsage: 1 m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295 m_RenderingLayerMask: 4294967295
m_Materials: m_Materials:
- {fileID: 2100000, guid: d1133891b03286946b3b0c63c1a57d08, type: 2} - {fileID: 2100000, guid: 83f430ba33ffd544bab7a13796246d30, type: 2}
m_StaticBatchInfo: m_StaticBatchInfo:
firstSubMesh: 0 firstSubMesh: 0
subMeshCount: 0 subMeshCount: 0

View file

@ -1,8 +1,8 @@
High Fidelity, Inc. High Fidelity, Inc.
Avatar Exporter 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: 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. 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.