2018-09-18 03:17:35 +00:00
|
|
|
#include <QVBoxLayout>
|
2018-09-21 07:10:18 +00:00
|
|
|
#include <QHBoxLayout>
|
2018-09-18 03:17:35 +00:00
|
|
|
#include <QFormLayout>
|
|
|
|
#include <QGridLayout>
|
|
|
|
#include <QMenu>
|
|
|
|
#include <QWidgetAction>
|
2018-09-21 07:10:18 +00:00
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QMessageBox>
|
2018-09-18 03:17:35 +00:00
|
|
|
#include "theme.h"
|
2018-09-21 07:10:18 +00:00
|
|
|
#include "poseeditwidget.h"
|
2018-09-18 03:17:35 +00:00
|
|
|
#include "floatnumberwidget.h"
|
2018-09-21 07:10:18 +00:00
|
|
|
#include "version.h"
|
2018-11-01 15:24:06 +00:00
|
|
|
#include "poserconstruct.h"
|
2018-09-18 03:17:35 +00:00
|
|
|
|
2018-10-25 00:19:38 +00:00
|
|
|
PoseEditWidget::PoseEditWidget(const Document *document, QWidget *parent) :
|
2018-09-21 07:10:18 +00:00
|
|
|
QDialog(parent),
|
2018-09-18 03:17:35 +00:00
|
|
|
m_document(document)
|
|
|
|
{
|
|
|
|
m_posePreviewManager = new PosePreviewManager();
|
|
|
|
connect(m_posePreviewManager, &PosePreviewManager::renderDone, [=]() {
|
2018-09-21 07:10:18 +00:00
|
|
|
if (m_closed) {
|
|
|
|
close();
|
|
|
|
return;
|
|
|
|
}
|
2018-09-18 03:17:35 +00:00
|
|
|
if (m_isPreviewDirty)
|
|
|
|
updatePreview();
|
|
|
|
});
|
2018-09-21 07:10:18 +00:00
|
|
|
connect(m_posePreviewManager, &PosePreviewManager::resultPreviewMeshChanged, [=]() {
|
|
|
|
m_previewWidget->updateMesh(m_posePreviewManager->takeResultPreviewMesh());
|
|
|
|
});
|
2018-09-18 03:17:35 +00:00
|
|
|
|
2018-09-21 07:10:18 +00:00
|
|
|
m_previewWidget = new ModelWidget(this);
|
|
|
|
m_previewWidget->setMinimumSize(128, 128);
|
|
|
|
m_previewWidget->resize(384, 384);
|
|
|
|
m_previewWidget->move(-64, -64+22);
|
|
|
|
|
|
|
|
QHBoxLayout *paramtersLayout = new QHBoxLayout;
|
2018-11-01 15:24:06 +00:00
|
|
|
paramtersLayout->setContentsMargins(0, 480, 0, 0);
|
2018-09-21 07:10:18 +00:00
|
|
|
paramtersLayout->addStretch();
|
|
|
|
paramtersLayout->addSpacing(20);
|
|
|
|
|
|
|
|
m_nameEdit = new QLineEdit;
|
2018-10-23 14:57:47 +00:00
|
|
|
m_nameEdit->setFixedWidth(200);
|
2018-09-21 07:10:18 +00:00
|
|
|
connect(m_nameEdit, &QLineEdit::textChanged, this, [=]() {
|
|
|
|
m_unsaved = true;
|
|
|
|
updateTitle();
|
|
|
|
});
|
|
|
|
QPushButton *saveButton = new QPushButton(tr("Save"));
|
|
|
|
connect(saveButton, &QPushButton::clicked, this, &PoseEditWidget::save);
|
|
|
|
saveButton->setDefault(true);
|
|
|
|
|
|
|
|
QHBoxLayout *baseInfoLayout = new QHBoxLayout;
|
|
|
|
baseInfoLayout->addWidget(new QLabel(tr("Name")));
|
|
|
|
baseInfoLayout->addWidget(m_nameEdit);
|
|
|
|
baseInfoLayout->addStretch();
|
|
|
|
baseInfoLayout->addWidget(saveButton);
|
|
|
|
|
|
|
|
QVBoxLayout *mainLayout = new QVBoxLayout;
|
|
|
|
mainLayout->addLayout(paramtersLayout);
|
|
|
|
mainLayout->addWidget(Theme::createHorizontalLineWidget());
|
|
|
|
mainLayout->addLayout(baseInfoLayout);
|
2018-09-18 03:17:35 +00:00
|
|
|
|
2018-09-21 07:10:18 +00:00
|
|
|
setLayout(mainLayout);
|
2018-09-18 03:17:35 +00:00
|
|
|
|
2018-10-25 00:19:38 +00:00
|
|
|
connect(m_document, &Document::resultRigChanged, this, &PoseEditWidget::updatePreview);
|
2018-09-21 07:10:18 +00:00
|
|
|
connect(this, &PoseEditWidget::parametersAdjusted, this, &PoseEditWidget::updatePreview);
|
|
|
|
connect(this, &PoseEditWidget::parametersAdjusted, [=]() {
|
|
|
|
m_unsaved = true;
|
|
|
|
updateTitle();
|
|
|
|
});
|
2018-10-25 00:19:38 +00:00
|
|
|
connect(this, &PoseEditWidget::addPose, m_document, &Document::addPose);
|
|
|
|
connect(this, &PoseEditWidget::renamePose, m_document, &Document::renamePose);
|
|
|
|
connect(this, &PoseEditWidget::setPoseParameters, m_document, &Document::setPoseParameters);
|
2018-09-21 07:10:18 +00:00
|
|
|
|
2018-11-01 15:24:06 +00:00
|
|
|
updateButtons();
|
2018-09-21 07:10:18 +00:00
|
|
|
updatePreview();
|
|
|
|
updateTitle();
|
2018-09-18 03:17:35 +00:00
|
|
|
}
|
|
|
|
|
2018-11-01 15:24:06 +00:00
|
|
|
void PoseEditWidget::updateButtons()
|
|
|
|
{
|
|
|
|
delete m_buttonsContainer;
|
|
|
|
m_buttonsContainer = new QWidget(this);
|
|
|
|
m_buttonsContainer->resize(600, 500);
|
|
|
|
m_buttonsContainer->move(256, 0);
|
|
|
|
m_buttonsContainer->show();
|
|
|
|
|
|
|
|
QGridLayout *marksContainerLayout = new QGridLayout;
|
|
|
|
marksContainerLayout->setContentsMargins(0, 0, 0, 0);
|
|
|
|
marksContainerLayout->setSpacing(2);
|
|
|
|
|
|
|
|
QFont buttonFont;
|
|
|
|
buttonFont.setWeight(QFont::Light);
|
|
|
|
buttonFont.setPixelSize(7);
|
|
|
|
buttonFont.setBold(false);
|
|
|
|
|
|
|
|
std::map<QString, std::tuple<QPushButton *, PopupWidgetType>> buttons;
|
|
|
|
const std::vector<RiggerBone> *rigBones = m_document->resultRigBones();
|
|
|
|
if (nullptr != rigBones && !rigBones->empty()) {
|
|
|
|
for (const auto &bone: *rigBones) {
|
|
|
|
if (!bone.hasButton)
|
|
|
|
continue;
|
|
|
|
QPushButton *buttonWidget = new QPushButton(bone.name);
|
|
|
|
PopupWidgetType widgetType = bone.buttonParameterType;
|
|
|
|
buttonWidget->setFont(buttonFont);
|
|
|
|
buttonWidget->setMaximumWidth(100);
|
|
|
|
QString boneName = bone.name;
|
|
|
|
connect(buttonWidget, &QPushButton::clicked, [this, boneName, widgetType]() {
|
|
|
|
emit showPopupAngleDialog(boneName, widgetType, mapFromGlobal(QCursor::pos()));
|
|
|
|
});
|
|
|
|
marksContainerLayout->addWidget(buttonWidget, bone.button.first, bone.button.second);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
marksContainerLayout->setSizeConstraint(QLayout::SizeConstraint::SetMinimumSize);
|
|
|
|
|
|
|
|
QVBoxLayout *mainLayouer = new QVBoxLayout;
|
|
|
|
mainLayouer->addStretch();
|
|
|
|
mainLayouer->addLayout(marksContainerLayout);
|
|
|
|
mainLayouer->addStretch();
|
|
|
|
|
|
|
|
m_buttonsContainer->setLayout(mainLayouer);
|
|
|
|
}
|
|
|
|
|
2018-09-21 07:10:18 +00:00
|
|
|
void PoseEditWidget::reject()
|
|
|
|
{
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PoseEditWidget::closeEvent(QCloseEvent *event)
|
|
|
|
{
|
|
|
|
if (m_unsaved && !m_closed) {
|
|
|
|
QMessageBox::StandardButton answer = QMessageBox::question(this,
|
|
|
|
APP_NAME,
|
|
|
|
tr("Do you really want to close while there are unsaved changes?"),
|
|
|
|
QMessageBox::Yes | QMessageBox::No);
|
|
|
|
if (answer != QMessageBox::Yes) {
|
|
|
|
event->ignore();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_closed = true;
|
|
|
|
hide();
|
|
|
|
if (m_openedMenuCount > 0) {
|
|
|
|
event->ignore();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (m_posePreviewManager->isRendering()) {
|
|
|
|
event->ignore();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
event->accept();
|
|
|
|
}
|
|
|
|
|
|
|
|
QSize PoseEditWidget::sizeHint() const
|
|
|
|
{
|
2018-11-01 15:24:06 +00:00
|
|
|
return QSize(1024, 768);
|
2018-09-21 07:10:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PoseEditWidget::~PoseEditWidget()
|
2018-09-18 03:17:35 +00:00
|
|
|
{
|
|
|
|
delete m_posePreviewManager;
|
|
|
|
}
|
|
|
|
|
2018-09-21 07:10:18 +00:00
|
|
|
void PoseEditWidget::updatePreview()
|
2018-09-18 03:17:35 +00:00
|
|
|
{
|
2018-09-21 07:10:18 +00:00
|
|
|
if (m_closed)
|
|
|
|
return;
|
|
|
|
|
2018-09-18 03:17:35 +00:00
|
|
|
if (m_posePreviewManager->isRendering()) {
|
|
|
|
m_isPreviewDirty = true;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-10-26 23:04:45 +00:00
|
|
|
const std::vector<RiggerBone> *rigBones = m_document->resultRigBones();
|
|
|
|
const std::map<int, RiggerVertexWeights> *rigWeights = m_document->resultRigWeights();
|
2018-09-18 03:17:35 +00:00
|
|
|
|
|
|
|
m_isPreviewDirty = false;
|
|
|
|
|
|
|
|
if (nullptr == rigBones || nullptr == rigWeights) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-11-01 15:24:06 +00:00
|
|
|
Poser *poser = newPoser(m_document->rigType, *rigBones);
|
|
|
|
if (nullptr == poser)
|
|
|
|
return;
|
|
|
|
|
2018-09-21 07:10:18 +00:00
|
|
|
poser->parameters() = m_parameters;
|
|
|
|
poser->commit();
|
2018-10-26 23:04:45 +00:00
|
|
|
m_posePreviewManager->postUpdate(*poser, m_document->currentRiggedOutcome(), *rigWeights);
|
2018-09-21 07:10:18 +00:00
|
|
|
delete poser;
|
2018-09-18 03:17:35 +00:00
|
|
|
}
|
|
|
|
|
2018-09-21 07:10:18 +00:00
|
|
|
void PoseEditWidget::setEditPoseId(QUuid poseId)
|
|
|
|
{
|
|
|
|
if (m_poseId == poseId)
|
|
|
|
return;
|
|
|
|
|
|
|
|
m_poseId = poseId;
|
|
|
|
updateTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PoseEditWidget::updateTitle()
|
|
|
|
{
|
|
|
|
if (m_poseId.isNull()) {
|
|
|
|
setWindowTitle(unifiedWindowTitle(tr("New") + (m_unsaved ? "*" : "")));
|
|
|
|
return;
|
|
|
|
}
|
2018-10-25 00:19:38 +00:00
|
|
|
const Pose *pose = m_document->findPose(m_poseId);
|
2018-09-21 07:10:18 +00:00
|
|
|
if (nullptr == pose) {
|
|
|
|
qDebug() << "Find pose failed:" << m_poseId;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
setWindowTitle(unifiedWindowTitle(pose->name + (m_unsaved ? "*" : "")));
|
|
|
|
}
|
|
|
|
|
|
|
|
void PoseEditWidget::showPopupAngleDialog(QString boneName, PopupWidgetType popupWidgetType, QPoint pos)
|
2018-09-18 03:17:35 +00:00
|
|
|
{
|
|
|
|
QMenu popupMenu;
|
|
|
|
|
|
|
|
QWidget *popup = new QWidget;
|
|
|
|
|
|
|
|
QVBoxLayout *layout = new QVBoxLayout;
|
|
|
|
|
|
|
|
if (PopupWidgetType::PitchYawRoll == popupWidgetType) {
|
|
|
|
FloatNumberWidget *pitchWidget = new FloatNumberWidget;
|
|
|
|
pitchWidget->setItemName(tr("Pitch"));
|
|
|
|
pitchWidget->setRange(-180, 180);
|
|
|
|
pitchWidget->setValue(valueOfKeyInMapOrEmpty(m_parameters[boneName], "pitch").toFloat());
|
2018-09-21 07:10:18 +00:00
|
|
|
connect(pitchWidget, &FloatNumberWidget::valueChanged, this, [=](float value) {
|
2018-09-18 03:17:35 +00:00
|
|
|
m_parameters[boneName]["pitch"] = QString::number(value);
|
2018-09-21 07:10:18 +00:00
|
|
|
emit parametersAdjusted();
|
2018-09-18 03:17:35 +00:00
|
|
|
});
|
|
|
|
QPushButton *pitchEraser = new QPushButton(QChar(fa::eraser));
|
|
|
|
Theme::initAwesomeMiniButton(pitchEraser);
|
2018-09-21 07:10:18 +00:00
|
|
|
connect(pitchEraser, &QPushButton::clicked, this, [=]() {
|
2018-09-18 03:17:35 +00:00
|
|
|
pitchWidget->setValue(0.0);
|
|
|
|
});
|
|
|
|
QHBoxLayout *pitchLayout = new QHBoxLayout;
|
|
|
|
pitchLayout->addWidget(pitchEraser);
|
|
|
|
pitchLayout->addWidget(pitchWidget);
|
|
|
|
layout->addLayout(pitchLayout);
|
|
|
|
|
|
|
|
FloatNumberWidget *yawWidget = new FloatNumberWidget;
|
|
|
|
yawWidget->setItemName(tr("Yaw"));
|
|
|
|
yawWidget->setRange(-180, 180);
|
|
|
|
yawWidget->setValue(valueOfKeyInMapOrEmpty(m_parameters[boneName], "yaw").toFloat());
|
2018-09-21 07:10:18 +00:00
|
|
|
connect(yawWidget, &FloatNumberWidget::valueChanged, this, [=](float value) {
|
2018-09-18 03:17:35 +00:00
|
|
|
m_parameters[boneName]["yaw"] = QString::number(value);
|
2018-09-21 07:10:18 +00:00
|
|
|
emit parametersAdjusted();
|
2018-09-18 03:17:35 +00:00
|
|
|
});
|
|
|
|
QPushButton *yawEraser = new QPushButton(QChar(fa::eraser));
|
|
|
|
Theme::initAwesomeMiniButton(yawEraser);
|
2018-09-21 07:10:18 +00:00
|
|
|
connect(yawEraser, &QPushButton::clicked, this, [=]() {
|
2018-09-18 03:17:35 +00:00
|
|
|
yawWidget->setValue(0.0);
|
|
|
|
});
|
|
|
|
QHBoxLayout *yawLayout = new QHBoxLayout;
|
|
|
|
yawLayout->addWidget(yawEraser);
|
|
|
|
yawLayout->addWidget(yawWidget);
|
|
|
|
layout->addLayout(yawLayout);
|
|
|
|
|
|
|
|
FloatNumberWidget *rollWidget = new FloatNumberWidget;
|
|
|
|
rollWidget->setItemName(tr("Roll"));
|
|
|
|
rollWidget->setRange(-180, 180);
|
|
|
|
rollWidget->setValue(valueOfKeyInMapOrEmpty(m_parameters[boneName], "roll").toFloat());
|
2018-09-21 07:10:18 +00:00
|
|
|
connect(rollWidget, &FloatNumberWidget::valueChanged, this, [=](float value) {
|
2018-09-18 03:17:35 +00:00
|
|
|
m_parameters[boneName]["roll"] = QString::number(value);
|
2018-09-21 07:10:18 +00:00
|
|
|
emit parametersAdjusted();
|
2018-09-18 03:17:35 +00:00
|
|
|
});
|
|
|
|
QPushButton *rollEraser = new QPushButton(QChar(fa::eraser));
|
|
|
|
Theme::initAwesomeMiniButton(rollEraser);
|
2018-09-21 07:10:18 +00:00
|
|
|
connect(rollEraser, &QPushButton::clicked, this, [=]() {
|
2018-09-18 03:17:35 +00:00
|
|
|
rollWidget->setValue(0.0);
|
|
|
|
});
|
|
|
|
QHBoxLayout *rollLayout = new QHBoxLayout;
|
|
|
|
rollLayout->addWidget(rollEraser);
|
|
|
|
rollLayout->addWidget(rollWidget);
|
|
|
|
layout->addLayout(rollLayout);
|
2018-11-01 15:24:06 +00:00
|
|
|
} else if (PopupWidgetType::Intersection == popupWidgetType) {
|
2018-09-18 03:17:35 +00:00
|
|
|
FloatNumberWidget *intersectionWidget = new FloatNumberWidget;
|
|
|
|
intersectionWidget->setItemName(tr("Intersection"));
|
|
|
|
intersectionWidget->setRange(-180, 180);
|
|
|
|
intersectionWidget->setValue(valueOfKeyInMapOrEmpty(m_parameters[boneName], "intersection").toFloat());
|
2018-09-21 07:10:18 +00:00
|
|
|
connect(intersectionWidget, &FloatNumberWidget::valueChanged, this, [=](float value) {
|
2018-09-18 03:17:35 +00:00
|
|
|
m_parameters[boneName]["intersection"] = QString::number(value);
|
2018-09-21 07:10:18 +00:00
|
|
|
emit parametersAdjusted();
|
2018-09-18 03:17:35 +00:00
|
|
|
});
|
|
|
|
QPushButton *intersectionEraser = new QPushButton(QChar(fa::eraser));
|
|
|
|
Theme::initAwesomeMiniButton(intersectionEraser);
|
2018-09-21 07:10:18 +00:00
|
|
|
connect(intersectionEraser, &QPushButton::clicked, this, [=]() {
|
2018-09-18 03:17:35 +00:00
|
|
|
intersectionWidget->setValue(0.0);
|
|
|
|
});
|
|
|
|
QHBoxLayout *intersectionLayout = new QHBoxLayout;
|
|
|
|
intersectionLayout->addWidget(intersectionEraser);
|
|
|
|
intersectionLayout->addWidget(intersectionWidget);
|
|
|
|
layout->addLayout(intersectionLayout);
|
2018-11-02 05:43:01 +00:00
|
|
|
} else if (PopupWidgetType::Translation == popupWidgetType) {
|
|
|
|
FloatNumberWidget *xWidget = new FloatNumberWidget;
|
|
|
|
xWidget->setItemName(tr("X"));
|
|
|
|
xWidget->setRange(-1, 1);
|
|
|
|
xWidget->setValue(valueOfKeyInMapOrEmpty(m_parameters[boneName], "x").toFloat());
|
|
|
|
connect(xWidget, &FloatNumberWidget::valueChanged, this, [=](float value) {
|
|
|
|
m_parameters[boneName]["x"] = QString::number(value);
|
|
|
|
emit parametersAdjusted();
|
|
|
|
});
|
|
|
|
QPushButton *xEraser = new QPushButton(QChar(fa::eraser));
|
|
|
|
Theme::initAwesomeMiniButton(xEraser);
|
|
|
|
connect(xEraser, &QPushButton::clicked, this, [=]() {
|
|
|
|
xWidget->setValue(0.0);
|
|
|
|
});
|
|
|
|
QHBoxLayout *xLayout = new QHBoxLayout;
|
|
|
|
xLayout->addWidget(xEraser);
|
|
|
|
xLayout->addWidget(xWidget);
|
|
|
|
layout->addLayout(xLayout);
|
|
|
|
|
|
|
|
FloatNumberWidget *yWidget = new FloatNumberWidget;
|
|
|
|
yWidget->setItemName(tr("Y"));
|
|
|
|
yWidget->setRange(-1, 1);
|
|
|
|
yWidget->setValue(valueOfKeyInMapOrEmpty(m_parameters[boneName], "y").toFloat());
|
|
|
|
connect(yWidget, &FloatNumberWidget::valueChanged, this, [=](float value) {
|
|
|
|
m_parameters[boneName]["y"] = QString::number(value);
|
|
|
|
emit parametersAdjusted();
|
|
|
|
});
|
|
|
|
QPushButton *yEraser = new QPushButton(QChar(fa::eraser));
|
|
|
|
Theme::initAwesomeMiniButton(yEraser);
|
|
|
|
connect(yEraser, &QPushButton::clicked, this, [=]() {
|
|
|
|
yWidget->setValue(0.0);
|
|
|
|
});
|
|
|
|
QHBoxLayout *yLayout = new QHBoxLayout;
|
|
|
|
yLayout->addWidget(yEraser);
|
|
|
|
yLayout->addWidget(yWidget);
|
|
|
|
layout->addLayout(yLayout);
|
|
|
|
|
|
|
|
FloatNumberWidget *zWidget = new FloatNumberWidget;
|
|
|
|
zWidget->setItemName(tr("Z"));
|
|
|
|
zWidget->setRange(-1, 1);
|
|
|
|
zWidget->setValue(valueOfKeyInMapOrEmpty(m_parameters[boneName], "z").toFloat());
|
|
|
|
connect(zWidget, &FloatNumberWidget::valueChanged, this, [=](float value) {
|
|
|
|
m_parameters[boneName]["z"] = QString::number(value);
|
|
|
|
emit parametersAdjusted();
|
|
|
|
});
|
|
|
|
QPushButton *zEraser = new QPushButton(QChar(fa::eraser));
|
|
|
|
Theme::initAwesomeMiniButton(zEraser);
|
|
|
|
connect(zEraser, &QPushButton::clicked, this, [=]() {
|
|
|
|
zWidget->setValue(0.0);
|
|
|
|
});
|
|
|
|
QHBoxLayout *zLayout = new QHBoxLayout;
|
|
|
|
zLayout->addWidget(zEraser);
|
|
|
|
zLayout->addWidget(zWidget);
|
|
|
|
layout->addLayout(zLayout);
|
2018-09-18 03:17:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
popup->setLayout(layout);
|
|
|
|
|
|
|
|
QWidgetAction action(this);
|
|
|
|
action.setDefaultWidget(popup);
|
|
|
|
|
|
|
|
popupMenu.addAction(&action);
|
|
|
|
|
2018-09-21 07:10:18 +00:00
|
|
|
m_openedMenuCount++;
|
2018-09-18 03:17:35 +00:00
|
|
|
popupMenu.exec(mapToGlobal(pos));
|
2018-09-21 07:10:18 +00:00
|
|
|
m_openedMenuCount--;
|
|
|
|
|
|
|
|
if (m_closed)
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PoseEditWidget::setEditPoseName(QString name)
|
|
|
|
{
|
|
|
|
m_nameEdit->setText(name);
|
|
|
|
updateTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PoseEditWidget::setEditParameters(std::map<QString, std::map<QString, QString>> parameters)
|
|
|
|
{
|
|
|
|
m_parameters = parameters;
|
|
|
|
updatePreview();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PoseEditWidget::clearUnsaveState()
|
|
|
|
{
|
|
|
|
m_unsaved = false;
|
|
|
|
updateTitle();
|
|
|
|
}
|
|
|
|
|
|
|
|
void PoseEditWidget::save()
|
|
|
|
{
|
|
|
|
if (m_poseId.isNull()) {
|
|
|
|
emit addPose(m_nameEdit->text(), m_parameters);
|
|
|
|
} else if (m_unsaved) {
|
|
|
|
emit renamePose(m_poseId, m_nameEdit->text());
|
|
|
|
emit setPoseParameters(m_poseId, m_parameters);
|
|
|
|
}
|
2018-09-21 08:14:37 +00:00
|
|
|
m_unsaved = false;
|
2018-09-21 07:10:18 +00:00
|
|
|
close();
|
2018-09-18 03:17:35 +00:00
|
|
|
}
|