mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 06:19:02 +02:00
fixes
This commit is contained in:
parent
74ce98a075
commit
e900d3784b
4 changed files with 25 additions and 32 deletions
|
@ -21,7 +21,6 @@ Item {
|
||||||
height: 40
|
height: 40
|
||||||
width: 134
|
width: 134
|
||||||
text: qsTr("Try Again")
|
text: qsTr("Try Again")
|
||||||
// colorScheme: root.colorScheme
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
avatarPackager.state = AvatarPackagerState.avatarDoctorDiagnose;
|
avatarPackager.state = AvatarPackagerState.avatarDoctorDiagnose;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +48,7 @@ Item {
|
||||||
color: "#EA4C5F"
|
color: "#EA4C5F"
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
//topMargin: 73
|
topMargin: -20
|
||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +59,7 @@ Item {
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
top: errorReportIcon.bottom
|
top: errorReportIcon.bottom
|
||||||
topMargin: 27
|
topMargin: -40
|
||||||
leftMargin: 13
|
leftMargin: 13
|
||||||
rightMargin: 13
|
rightMargin: 13
|
||||||
}
|
}
|
||||||
|
@ -68,15 +67,6 @@ Item {
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: errorRepeater
|
id: errorRepeater
|
||||||
/*model: [
|
|
||||||
{message: "Rig is not Hifi compatible", url: "http://www.highfidelity.com/"},
|
|
||||||
{message: "Bone limit exceeds 256", url: "http://www.highfidelity.com/2"},
|
|
||||||
{message: "Unsupported Texture", url: "http://www.highfidelity.com/texture"},
|
|
||||||
{message: "Rig is not Hifi compatible", url: "http://www.highfidelity.com/"},
|
|
||||||
{message: "Bone limit exceeds 256", url: "http://www.highfidelity.com/2"},
|
|
||||||
{message: "Unsupported Texture", url: "http://www.highfidelity.com/texture"}
|
|
||||||
]*/
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
height: 37
|
height: 37
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
@ -89,6 +79,7 @@ Item {
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
left: parent.left
|
left: parent.left
|
||||||
|
leftMargin: -5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,17 +87,18 @@ Item {
|
||||||
id: errorLink
|
id: errorLink
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
|
topMargin: 5
|
||||||
left: errorIcon.right
|
left: errorIcon.right
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
linkColor: "#00B4EF"// style.colors.blueHighlight
|
color: "#00B4EF"
|
||||||
|
linkColor: "#00B4EF"
|
||||||
size: 28
|
size: 28
|
||||||
text: "<a href='javascript:void'>" + modelData.message + "</a>"
|
text: "<a href='javascript:void'>" + modelData.message + "</a>"
|
||||||
onLinkActivated: Qt.openUrlExternally(modelData.url)
|
onLinkActivated: Qt.openUrlExternally(modelData.url)
|
||||||
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,11 +14,22 @@
|
||||||
#include <AvatarConstants.h>
|
#include <AvatarConstants.h>
|
||||||
#include <ResourceManager.h>
|
#include <ResourceManager.h>
|
||||||
|
|
||||||
|
|
||||||
AvatarDoctor::AvatarDoctor(QUrl avatarFSTFileUrl) :
|
AvatarDoctor::AvatarDoctor(QUrl avatarFSTFileUrl) :
|
||||||
_avatarFSTFileUrl(std::move(avatarFSTFileUrl)) {
|
_avatarFSTFileUrl(avatarFSTFileUrl) {
|
||||||
|
|
||||||
|
connect(this, &AvatarDoctor::complete, this, [this](QVariantList errors) {
|
||||||
|
_isDiagnosing = false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarDoctor::startDiagnosing() {
|
void AvatarDoctor::startDiagnosing() {
|
||||||
|
if (_isDiagnosing) {
|
||||||
|
// One diagnose at a time for now
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_isDiagnosing = true;
|
||||||
|
|
||||||
_errors.clear();
|
_errors.clear();
|
||||||
|
|
||||||
_externalTextureCount = 0;
|
_externalTextureCount = 0;
|
||||||
|
@ -47,8 +58,7 @@ void AvatarDoctor::startDiagnosing() {
|
||||||
// RIG
|
// RIG
|
||||||
if (avatarModel.joints.isEmpty()) {
|
if (avatarModel.joints.isEmpty()) {
|
||||||
_errors.push_back({ "Avatar has no rig", DEFAULT_URL });
|
_errors.push_back({ "Avatar has no rig", DEFAULT_URL });
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (avatarModel.joints.length() > 256) {
|
if (avatarModel.joints.length() > 256) {
|
||||||
_errors.push_back({ "Avatar has over 256 bones", DEFAULT_URL });
|
_errors.push_back({ "Avatar has over 256 bones", DEFAULT_URL });
|
||||||
}
|
}
|
||||||
|
@ -69,13 +79,10 @@ void AvatarDoctor::startDiagnosing() {
|
||||||
const float RECOMMENDED_MAX_HEIGHT = DEFAULT_AVATAR_HEIGHT * 1.5f;
|
const float RECOMMENDED_MAX_HEIGHT = DEFAULT_AVATAR_HEIGHT * 1.5f;
|
||||||
|
|
||||||
const float avatarHeight = avatarModel.bindExtents.largestDimension();
|
const float avatarHeight = avatarModel.bindExtents.largestDimension();
|
||||||
|
|
||||||
qDebug() << "avatarHeight" << avatarHeight;
|
|
||||||
qDebug() << "defined Scale =" << model->getMapping()["scale"].toFloat();
|
|
||||||
if (avatarHeight < RECOMMENDED_MIN_HEIGHT) {
|
if (avatarHeight < RECOMMENDED_MIN_HEIGHT) {
|
||||||
_errors.push_back({ "Avatar is possibly smaller then expected.", DEFAULT_URL });
|
_errors.push_back({ "Avatar is possibly too small.", DEFAULT_URL });
|
||||||
} else if (avatarHeight > RECOMMENDED_MAX_HEIGHT) {
|
} else if (avatarHeight > RECOMMENDED_MAX_HEIGHT) {
|
||||||
_errors.push_back({ "Avatar is possibly larger then expected.", DEFAULT_URL });
|
_errors.push_back({ "Avatar is possibly too large.", DEFAULT_URL });
|
||||||
}
|
}
|
||||||
|
|
||||||
// TEXTURES
|
// TEXTURES
|
||||||
|
@ -119,7 +126,7 @@ void AvatarDoctor::startDiagnosing() {
|
||||||
qDebug() << "checkTextureLoadingComplete" << _checkedTextureCount << "/" << _externalTextureCount;
|
qDebug() << "checkTextureLoadingComplete" << _checkedTextureCount << "/" << _externalTextureCount;
|
||||||
|
|
||||||
if (_checkedTextureCount == _externalTextureCount) {
|
if (_checkedTextureCount == _externalTextureCount) {
|
||||||
if (_missingTextureCount == 1) {
|
if (_missingTextureCount > 0) {
|
||||||
_errors.push_back({ tr("Missing %n texture(s).","", _missingTextureCount), DEFAULT_URL });
|
_errors.push_back({ tr("Missing %n texture(s).","", _missingTextureCount), DEFAULT_URL });
|
||||||
}
|
}
|
||||||
if (_unsupportedTextureCount > 0) {
|
if (_unsupportedTextureCount > 0) {
|
||||||
|
|
|
@ -13,17 +13,11 @@
|
||||||
#ifndef hifi_AvatarDoctor_h
|
#ifndef hifi_AvatarDoctor_h
|
||||||
#define hifi_AvatarDoctor_h
|
#define hifi_AvatarDoctor_h
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
struct AvatarDiagnosticResult {
|
struct AvatarDiagnosticResult {
|
||||||
|
|
||||||
//public:
|
|
||||||
// AvatarDiagnosticResult() {}
|
|
||||||
// AvatarDiagnosticResult(QString message, QUrl url) : _message(std::move(message)), _url(std::move(url)) { }
|
|
||||||
//private:
|
|
||||||
QString message;
|
QString message;
|
||||||
QUrl url;
|
QUrl url;
|
||||||
};
|
};
|
||||||
|
@ -50,6 +44,8 @@ private:
|
||||||
int _checkedTextureCount = 0;
|
int _checkedTextureCount = 0;
|
||||||
int _missingTextureCount = 0;
|
int _missingTextureCount = 0;
|
||||||
int _unsupportedTextureCount = 0;
|
int _unsupportedTextureCount = 0;
|
||||||
|
|
||||||
|
bool _isDiagnosing = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_AvatarDoctor_h
|
#endif // hifi_AvatarDoctor_h
|
||||||
|
|
|
@ -32,8 +32,6 @@ AvatarPackager::AvatarPackager() {
|
||||||
qRegisterMetaType<AvatarPackager*>();
|
qRegisterMetaType<AvatarPackager*>();
|
||||||
qRegisterMetaType<AvatarProject*>();
|
qRegisterMetaType<AvatarProject*>();
|
||||||
qRegisterMetaType<AvatarDoctor*>();
|
qRegisterMetaType<AvatarDoctor*>();
|
||||||
qRegisterMetaType<AvatarDiagnosticResult>();
|
|
||||||
qRegisterMetaType<QVector<AvatarDiagnosticResult>>();
|
|
||||||
qRegisterMetaType<AvatarProjectStatus::AvatarProjectStatus>();
|
qRegisterMetaType<AvatarProjectStatus::AvatarProjectStatus>();
|
||||||
qmlRegisterUncreatableMetaObject(
|
qmlRegisterUncreatableMetaObject(
|
||||||
AvatarProjectStatus::staticMetaObject,
|
AvatarProjectStatus::staticMetaObject,
|
||||||
|
|
Loading…
Reference in a new issue