mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 20:36:49 +02:00
- add jointIndexes to new
- attempt to fix OSX / linux build - ability to actually load a recent project (previously was only able to load the top recent project)
This commit is contained in:
parent
2f32458f72
commit
1a38abe230
6 changed files with 21 additions and 19 deletions
|
@ -84,6 +84,11 @@ Windows.ScrollingWindow {
|
||||||
|
|
||||||
property alias showModalOverlay: modalOverlay.visible
|
property alias showModalOverlay: modalOverlay.visible
|
||||||
|
|
||||||
|
function openProject(path) {
|
||||||
|
AvatarPackagerCore.openAvatarProject(path);
|
||||||
|
avatarPackager.state = "project";
|
||||||
|
}
|
||||||
|
|
||||||
AvatarPackagerHeader {
|
AvatarPackagerHeader {
|
||||||
id: avatarPackagerHeader
|
id: avatarPackagerHeader
|
||||||
onBackButtonClicked: {
|
onBackButtonClicked: {
|
||||||
|
@ -175,7 +180,6 @@ Windows.ScrollingWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Flow {
|
Flow {
|
||||||
visible: AvatarPackagerCore.recentProjects.length === 0
|
visible: AvatarPackagerCore.recentProjects.length === 0
|
||||||
anchors {
|
anchors {
|
||||||
|
@ -194,8 +198,6 @@ Windows.ScrollingWindow {
|
||||||
color: "white"
|
color: "white"
|
||||||
text: qsTr("To learn more about using this tool, visit our docs")
|
text: qsTr("To learn more about using this tool, visit our docs")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
@ -213,6 +215,7 @@ Windows.ScrollingWindow {
|
||||||
AvatarProjectCard {
|
AvatarProjectCard {
|
||||||
title: modelData.name
|
title: modelData.name
|
||||||
path: modelData.path
|
path: modelData.path
|
||||||
|
onOpen: avatarPackager.openProject(modelData.path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,8 @@ Item {
|
||||||
property color hoverBackgroundColor: "#E3E3E3"
|
property color hoverBackgroundColor: "#E3E3E3"
|
||||||
property color pressedBackgroundColor: "#6A6A6A"
|
property color pressedBackgroundColor: "#6A6A6A"
|
||||||
|
|
||||||
|
signal open;
|
||||||
|
|
||||||
state: mouseArea.pressed ? "pressed" : (mouseArea.containsMouse ? "hover" : "normal")
|
state: mouseArea.pressed ? "pressed" : (mouseArea.containsMouse ? "hover" : "normal")
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
|
@ -77,8 +79,7 @@ Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
AvatarPackagerCore.openAvatarProject(path.text);
|
open();
|
||||||
avatarPackager.state = "project";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,9 +23,8 @@
|
||||||
|
|
||||||
class RecentAvatarProject {
|
class RecentAvatarProject {
|
||||||
public:
|
public:
|
||||||
RecentAvatarProject() {
|
RecentAvatarProject() = default;
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
RecentAvatarProject(QString projectName, QString projectFSTPath) {
|
RecentAvatarProject(QString projectName, QString projectFSTPath) {
|
||||||
_projectName = projectName;
|
_projectName = projectName;
|
||||||
|
@ -36,6 +35,8 @@ public:
|
||||||
_projectFSTPath = other._projectFSTPath;
|
_projectFSTPath = other._projectFSTPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~RecentAvatarProject() = default;
|
||||||
|
|
||||||
QString getProjectName() const { return _projectName; }
|
QString getProjectName() const { return _projectName; }
|
||||||
|
|
||||||
QString getProjectFSTPath() const { return _projectFSTPath; }
|
QString getProjectFSTPath() const { return _projectFSTPath; }
|
||||||
|
@ -50,15 +51,6 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline QDebug operator<<(QDebug debug, const RecentAvatarProject& recentAvatarProject) {
|
|
||||||
debug << "[recentAvatarProject:" << recentAvatarProject.getProjectFSTPath() << "]";
|
|
||||||
return debug;
|
|
||||||
}
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(RecentAvatarProject);
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QVector<RecentAvatarProject>);
|
|
||||||
|
|
||||||
class AvatarPackager : public QObject, public Dependency {
|
class AvatarPackager : public QObject, public Dependency {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
SINGLETON_DEPENDENCY
|
SINGLETON_DEPENDENCY
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
class AvatarProject : public QObject {
|
class AvatarProject : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(FST* fst READ getFST)
|
Q_PROPERTY(FST* fst READ getFST CONSTANT)
|
||||||
|
|
||||||
Q_PROPERTY(QStringList projectFiles READ getProjectFiles NOTIFY projectFilesChanged)
|
Q_PROPERTY(QStringList projectFiles READ getProjectFiles NOTIFY projectFilesChanged)
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ MarketplaceItemUploader::MarketplaceItemUploader(QString title,
|
||||||
QUuid marketplaceID,
|
QUuid marketplaceID,
|
||||||
QStringList filePaths) :
|
QStringList filePaths) :
|
||||||
_title(title),
|
_title(title),
|
||||||
_description(description), _rootFilename(rootFilename), _filePaths(filePaths), _marketplaceID(marketplaceID) {
|
_description(description), _rootFilename(rootFilename), _marketplaceID(marketplaceID), _filePaths(filePaths) {
|
||||||
qWarning() << "File paths: " << _filePaths.join(", ");
|
qWarning() << "File paths: " << _filePaths.join(", ");
|
||||||
//_marketplaceID = QUuid::fromString(QLatin1String("{50dbd62f-cb6b-4be4-afb8-1ef8bd2dffa8}"));
|
//_marketplaceID = QUuid::fromString(QLatin1String("{50dbd62f-cb6b-4be4-afb8-1ef8bd2dffa8}"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,6 +74,12 @@ FST* FST::createFSTFromModel(QString fstPath, QString modelFilePath, const hfm::
|
||||||
|
|
||||||
mapping.insert(JOINT_FIELD, joints);
|
mapping.insert(JOINT_FIELD, joints);
|
||||||
|
|
||||||
|
QVariantHash jointIndices;
|
||||||
|
for (int i = 0; i < hfmModel.joints.size(); i++) {
|
||||||
|
jointIndices.insert(hfmModel.joints.at(i).name, QString::number(i));
|
||||||
|
}
|
||||||
|
mapping.insert(JOINT_INDEX_FIELD, jointIndices);
|
||||||
|
|
||||||
mapping.insertMulti(FREE_JOINT_FIELD, "LeftArm");
|
mapping.insertMulti(FREE_JOINT_FIELD, "LeftArm");
|
||||||
mapping.insertMulti(FREE_JOINT_FIELD, "LeftForeArm");
|
mapping.insertMulti(FREE_JOINT_FIELD, "LeftForeArm");
|
||||||
mapping.insertMulti(FREE_JOINT_FIELD, "RightArm");
|
mapping.insertMulti(FREE_JOINT_FIELD, "RightArm");
|
||||||
|
|
Loading…
Reference in a new issue