2018-10-25 00:19:38 +00:00
|
|
|
#ifndef DUST3D_MOTION_EDIT_WIDGET_H
|
|
|
|
#define DUST3D_MOTION_EDIT_WIDGET_H
|
2018-10-02 04:59:30 +00:00
|
|
|
#include <QDialog>
|
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QCloseEvent>
|
2018-10-25 00:19:38 +00:00
|
|
|
#include "document.h"
|
2018-10-23 14:57:47 +00:00
|
|
|
#include "motiontimelinewidget.h"
|
2018-10-02 04:59:30 +00:00
|
|
|
#include "modelwidget.h"
|
2018-10-23 14:57:47 +00:00
|
|
|
#include "motionsgenerator.h"
|
2018-10-02 04:59:30 +00:00
|
|
|
#include "animationclipplayer.h"
|
|
|
|
|
|
|
|
class MotionEditWidget : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
signals:
|
2018-11-09 15:07:26 +00:00
|
|
|
void addMotion(QUuid motionId, QString name, std::vector<MotionClip> clips);
|
2018-10-25 00:19:38 +00:00
|
|
|
void setMotionClips(QUuid motionId, std::vector<MotionClip> clips);
|
2018-10-02 04:59:30 +00:00
|
|
|
void renameMotion(QUuid motionId, QString name);
|
|
|
|
public:
|
2018-10-25 00:19:38 +00:00
|
|
|
MotionEditWidget(const Document *document, QWidget *parent=nullptr);
|
2018-10-02 04:59:30 +00:00
|
|
|
~MotionEditWidget();
|
|
|
|
protected:
|
|
|
|
void closeEvent(QCloseEvent *event) override;
|
|
|
|
void reject() override;
|
|
|
|
QSize sizeHint() const override;
|
|
|
|
public slots:
|
|
|
|
void updateTitle();
|
|
|
|
void save();
|
|
|
|
void clearUnsaveState();
|
|
|
|
void setEditMotionId(QUuid poseId);
|
|
|
|
void setEditMotionName(QString name);
|
2018-10-25 00:19:38 +00:00
|
|
|
void setEditMotionClips(std::vector<MotionClip> clips);
|
2018-10-02 04:59:30 +00:00
|
|
|
void setUnsavedState();
|
|
|
|
void generatePreviews();
|
|
|
|
void previewsReady();
|
|
|
|
private:
|
2018-10-25 00:19:38 +00:00
|
|
|
const Document *m_document = nullptr;
|
2018-10-23 14:57:47 +00:00
|
|
|
MotionTimelineWidget *m_timelineWidget = nullptr;
|
2018-10-02 04:59:30 +00:00
|
|
|
ModelWidget *m_previewWidget = nullptr;
|
|
|
|
QUuid m_motionId;
|
|
|
|
QLineEdit *m_nameEdit = nullptr;
|
|
|
|
std::vector<std::pair<float, QUuid>> m_keyframes;
|
|
|
|
bool m_unsaved = false;
|
|
|
|
bool m_closed = false;
|
|
|
|
bool m_isPreviewsObsolete = false;
|
2018-10-23 14:57:47 +00:00
|
|
|
MotionsGenerator *m_previewsGenerator = nullptr;
|
2018-10-02 04:59:30 +00:00
|
|
|
AnimationClipPlayer *m_clipPlayer = nullptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|