2018-10-25 00:19:38 +00:00
|
|
|
#ifndef DUST3D_DOCUMENT_H
|
|
|
|
#define DUST3D_DOCUMENT_H
|
2018-04-07 08:44:39 +00:00
|
|
|
#include <QObject>
|
|
|
|
#include <QUuid>
|
|
|
|
#include <vector>
|
|
|
|
#include <map>
|
|
|
|
#include <set>
|
2018-04-08 23:34:46 +00:00
|
|
|
#include <deque>
|
2018-04-07 08:44:39 +00:00
|
|
|
#include <QImage>
|
2018-04-17 13:13:32 +00:00
|
|
|
#include <cmath>
|
2018-08-27 08:50:40 +00:00
|
|
|
#include <algorithm>
|
|
|
|
#include <QOpenGLWidget>
|
2018-10-25 00:19:38 +00:00
|
|
|
#include "snapshot.h"
|
2018-05-07 17:16:58 +00:00
|
|
|
#include "meshloader.h"
|
2018-04-07 08:44:39 +00:00
|
|
|
#include "meshgenerator.h"
|
2018-04-26 02:23:22 +00:00
|
|
|
#include "theme.h"
|
2018-05-07 16:08:19 +00:00
|
|
|
#include "texturegenerator.h"
|
|
|
|
#include "meshresultpostprocessor.h"
|
2018-10-25 00:19:38 +00:00
|
|
|
#include "bonemark.h"
|
2018-09-14 09:45:05 +00:00
|
|
|
#include "riggenerator.h"
|
|
|
|
#include "rigtype.h"
|
2018-09-21 07:10:18 +00:00
|
|
|
#include "posepreviewsgenerator.h"
|
2018-10-09 02:19:12 +00:00
|
|
|
#include "texturetype.h"
|
2018-10-23 14:57:47 +00:00
|
|
|
#include "interpolationtype.h"
|
|
|
|
#include "jointnodetree.h"
|
2018-11-03 08:09:42 +00:00
|
|
|
#include "skeletondocument.h"
|
2018-11-14 13:21:45 +00:00
|
|
|
#include "combinemode.h"
|
2019-06-01 13:12:53 +00:00
|
|
|
#include "preferences.h"
|
2019-08-17 10:13:11 +00:00
|
|
|
#include "paintmode.h"
|
2019-09-21 14:30:27 +00:00
|
|
|
#include "proceduralanimation.h"
|
2018-10-09 02:19:12 +00:00
|
|
|
|
|
|
|
class MaterialPreviewsGenerator;
|
2018-10-23 14:57:47 +00:00
|
|
|
class MotionsGenerator;
|
2019-07-20 11:57:26 +00:00
|
|
|
class ScriptRunner;
|
2019-08-08 11:24:33 +00:00
|
|
|
class MousePicker;
|
2018-04-07 08:44:39 +00:00
|
|
|
|
2018-10-25 00:19:38 +00:00
|
|
|
class HistoryItem
|
2018-04-07 08:44:39 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-10-25 06:27:59 +00:00
|
|
|
uint32_t hash;
|
2018-10-25 00:19:38 +00:00
|
|
|
Snapshot snapshot;
|
2018-04-07 08:44:39 +00:00
|
|
|
};
|
|
|
|
|
2018-10-25 00:19:38 +00:00
|
|
|
class Component
|
2018-06-15 05:34:41 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-10-25 00:19:38 +00:00
|
|
|
Component()
|
2018-08-27 08:50:40 +00:00
|
|
|
{
|
|
|
|
}
|
2018-10-25 00:19:38 +00:00
|
|
|
Component(const QUuid &withId, const QString &linkData=QString(), const QString &linkDataType=QString())
|
2018-08-27 08:50:40 +00:00
|
|
|
{
|
|
|
|
id = withId.isNull() ? QUuid::createUuid() : withId;
|
|
|
|
if (!linkData.isEmpty()) {
|
|
|
|
if ("partId" == linkDataType) {
|
|
|
|
linkToPartId = QUuid(linkData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
QUuid id;
|
|
|
|
QString name;
|
|
|
|
QUuid linkToPartId;
|
|
|
|
QUuid parentId;
|
|
|
|
bool expanded = true;
|
2019-06-01 13:12:53 +00:00
|
|
|
CombineMode combineMode = Preferences::instance().componentCombineMode();
|
2018-08-27 08:50:40 +00:00
|
|
|
bool dirty = true;
|
2018-09-06 15:04:59 +00:00
|
|
|
float smoothAll = 0.0;
|
|
|
|
float smoothSeam = 0.0;
|
2018-08-27 08:50:40 +00:00
|
|
|
std::vector<QUuid> childrenIds;
|
|
|
|
QString linkData() const
|
|
|
|
{
|
|
|
|
return linkToPartId.isNull() ? QString() : linkToPartId.toString();
|
|
|
|
}
|
|
|
|
QString linkDataType() const
|
|
|
|
{
|
|
|
|
return linkToPartId.isNull() ? QString() : QString("partId");
|
|
|
|
}
|
|
|
|
void addChild(QUuid childId)
|
|
|
|
{
|
|
|
|
if (m_childrenIdSet.find(childId) != m_childrenIdSet.end())
|
|
|
|
return;
|
|
|
|
m_childrenIdSet.insert(childId);
|
|
|
|
childrenIds.push_back(childId);
|
|
|
|
}
|
|
|
|
void removeChild(QUuid childId)
|
|
|
|
{
|
|
|
|
if (m_childrenIdSet.find(childId) == m_childrenIdSet.end())
|
|
|
|
return;
|
|
|
|
m_childrenIdSet.erase(childId);
|
|
|
|
auto findResult = std::find(childrenIds.begin(), childrenIds.end(), childId);
|
|
|
|
if (findResult != childrenIds.end())
|
|
|
|
childrenIds.erase(findResult);
|
|
|
|
}
|
|
|
|
void replaceChild(QUuid childId, QUuid newId)
|
|
|
|
{
|
|
|
|
if (m_childrenIdSet.find(childId) == m_childrenIdSet.end())
|
|
|
|
return;
|
|
|
|
if (m_childrenIdSet.find(newId) != m_childrenIdSet.end())
|
|
|
|
return;
|
|
|
|
m_childrenIdSet.erase(childId);
|
|
|
|
m_childrenIdSet.insert(newId);
|
|
|
|
auto findResult = std::find(childrenIds.begin(), childrenIds.end(), childId);
|
|
|
|
if (findResult != childrenIds.end())
|
|
|
|
*findResult = newId;
|
|
|
|
}
|
|
|
|
void moveChildUp(QUuid childId)
|
|
|
|
{
|
|
|
|
auto it = std::find(childrenIds.begin(), childrenIds.end(), childId);
|
|
|
|
if (it == childrenIds.end()) {
|
|
|
|
qDebug() << "Child not found in list:" << childId;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto index = std::distance(childrenIds.begin(), it);
|
|
|
|
if (index == 0)
|
|
|
|
return;
|
|
|
|
std::swap(childrenIds[index - 1], childrenIds[index]);
|
|
|
|
}
|
|
|
|
void moveChildDown(QUuid childId)
|
|
|
|
{
|
|
|
|
auto it = std::find(childrenIds.begin(), childrenIds.end(), childId);
|
|
|
|
if (it == childrenIds.end()) {
|
|
|
|
qDebug() << "Child not found in list:" << childId;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto index = std::distance(childrenIds.begin(), it);
|
|
|
|
if (index == (int)childrenIds.size() - 1)
|
|
|
|
return;
|
|
|
|
std::swap(childrenIds[index], childrenIds[index + 1]);
|
|
|
|
}
|
|
|
|
void moveChildToTop(QUuid childId)
|
|
|
|
{
|
|
|
|
auto it = std::find(childrenIds.begin(), childrenIds.end(), childId);
|
|
|
|
if (it == childrenIds.end()) {
|
|
|
|
qDebug() << "Child not found in list:" << childId;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto index = std::distance(childrenIds.begin(), it);
|
|
|
|
if (index == 0)
|
|
|
|
return;
|
|
|
|
for (int i = index; i >= 1; i--)
|
|
|
|
std::swap(childrenIds[i - 1], childrenIds[i]);
|
|
|
|
}
|
|
|
|
void moveChildToBottom(QUuid childId)
|
|
|
|
{
|
|
|
|
auto it = std::find(childrenIds.begin(), childrenIds.end(), childId);
|
|
|
|
if (it == childrenIds.end()) {
|
|
|
|
qDebug() << "Child not found in list:" << childId;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto index = std::distance(childrenIds.begin(), it);
|
|
|
|
if (index == (int)childrenIds.size() - 1)
|
|
|
|
return;
|
|
|
|
for (int i = index; i <= (int)childrenIds.size() - 2; i++)
|
|
|
|
std::swap(childrenIds[i], childrenIds[i + 1]);
|
|
|
|
}
|
2018-09-06 15:04:59 +00:00
|
|
|
void setSmoothAll(float toSmoothAll)
|
|
|
|
{
|
|
|
|
if (toSmoothAll < 0)
|
|
|
|
toSmoothAll = 0;
|
|
|
|
else if (toSmoothAll > 1)
|
|
|
|
toSmoothAll = 1;
|
|
|
|
smoothAll = toSmoothAll;
|
|
|
|
}
|
|
|
|
void setSmoothSeam(float toSmoothSeam)
|
|
|
|
{
|
|
|
|
if (toSmoothSeam < 0)
|
|
|
|
toSmoothSeam = 0;
|
|
|
|
else if (toSmoothSeam > 1)
|
|
|
|
toSmoothSeam = 1;
|
|
|
|
smoothSeam = toSmoothSeam;
|
|
|
|
}
|
|
|
|
bool smoothAllAdjusted() const
|
|
|
|
{
|
|
|
|
return fabs(smoothAll - 0.0) >= 0.01;
|
|
|
|
}
|
|
|
|
bool smoothSeamAdjusted() const
|
|
|
|
{
|
|
|
|
return fabs(smoothSeam - 0.0) >= 0.01;
|
|
|
|
}
|
|
|
|
bool smoothAdjusted() const
|
|
|
|
{
|
|
|
|
return smoothAllAdjusted() || smoothSeamAdjusted();
|
|
|
|
}
|
2018-08-27 08:50:40 +00:00
|
|
|
private:
|
|
|
|
std::set<QUuid> m_childrenIdSet;
|
2018-06-15 05:34:41 +00:00
|
|
|
};
|
|
|
|
|
2018-10-25 00:19:38 +00:00
|
|
|
class Pose
|
2018-09-21 07:10:18 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-10-25 00:19:38 +00:00
|
|
|
Pose()
|
2018-09-21 07:10:18 +00:00
|
|
|
{
|
|
|
|
}
|
2018-10-25 00:19:38 +00:00
|
|
|
~Pose()
|
2018-09-21 07:10:18 +00:00
|
|
|
{
|
|
|
|
delete m_previewMesh;
|
|
|
|
}
|
|
|
|
QUuid id;
|
|
|
|
QString name;
|
|
|
|
bool dirty = true;
|
2018-11-09 03:20:48 +00:00
|
|
|
QUuid turnaroundImageId;
|
2019-06-19 12:57:38 +00:00
|
|
|
float yTranslationScale = 1.0;
|
2018-11-09 03:20:48 +00:00
|
|
|
std::vector<std::pair<std::map<QString, QString>, std::map<QString, std::map<QString, QString>>>> frames; // pair<attributes, parameters>
|
2018-09-21 07:10:18 +00:00
|
|
|
void updatePreviewMesh(MeshLoader *previewMesh)
|
|
|
|
{
|
|
|
|
delete m_previewMesh;
|
|
|
|
m_previewMesh = previewMesh;
|
|
|
|
}
|
|
|
|
MeshLoader *takePreviewMesh() const
|
|
|
|
{
|
|
|
|
if (nullptr == m_previewMesh)
|
|
|
|
return nullptr;
|
|
|
|
return new MeshLoader(*m_previewMesh);
|
|
|
|
}
|
2019-06-19 12:57:38 +00:00
|
|
|
bool yTranslationScaleAdjusted() const
|
|
|
|
{
|
|
|
|
return fabs(yTranslationScale - 1.0) >= 0.01;
|
|
|
|
}
|
2018-09-21 07:10:18 +00:00
|
|
|
private:
|
2018-10-25 00:19:38 +00:00
|
|
|
Q_DISABLE_COPY(Pose);
|
2018-09-21 07:10:18 +00:00
|
|
|
MeshLoader *m_previewMesh = nullptr;
|
|
|
|
};
|
|
|
|
|
2018-10-25 00:19:38 +00:00
|
|
|
enum class MotionClipType
|
2018-10-23 14:57:47 +00:00
|
|
|
{
|
|
|
|
Pose,
|
|
|
|
Interpolation,
|
2019-09-21 14:30:27 +00:00
|
|
|
Motion,
|
|
|
|
ProceduralAnimation
|
2018-10-23 14:57:47 +00:00
|
|
|
};
|
|
|
|
|
2018-10-25 00:19:38 +00:00
|
|
|
class MotionClip
|
2018-10-23 14:57:47 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-10-25 00:19:38 +00:00
|
|
|
MotionClip()
|
2018-10-23 14:57:47 +00:00
|
|
|
{
|
|
|
|
}
|
2018-10-25 00:19:38 +00:00
|
|
|
MotionClip(const QString &linkData, const QString &linkDataType)
|
2018-10-23 14:57:47 +00:00
|
|
|
{
|
|
|
|
if ("poseId" == linkDataType) {
|
2018-10-25 00:19:38 +00:00
|
|
|
clipType = MotionClipType::Pose;
|
2018-10-23 14:57:47 +00:00
|
|
|
linkToId = QUuid(linkData);
|
|
|
|
} else if ("InterpolationType" == linkDataType) {
|
2018-10-25 00:19:38 +00:00
|
|
|
clipType = MotionClipType::Interpolation;
|
2018-10-23 14:57:47 +00:00
|
|
|
interpolationType = InterpolationTypeFromString(linkData.toUtf8().constData());
|
2019-09-21 14:30:27 +00:00
|
|
|
} else if ("ProceduralAnimation" == linkDataType) {
|
|
|
|
clipType = MotionClipType::ProceduralAnimation;
|
|
|
|
proceduralAnimation = ProceduralAnimationFromString(linkData.toUtf8().constData());
|
2018-10-23 14:57:47 +00:00
|
|
|
} else if ("motionId" == linkDataType) {
|
2018-10-25 00:19:38 +00:00
|
|
|
clipType = MotionClipType::Motion;
|
2018-10-23 14:57:47 +00:00
|
|
|
linkToId = QUuid(linkData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
QString linkDataType() const
|
|
|
|
{
|
2018-10-25 00:19:38 +00:00
|
|
|
if (MotionClipType::Pose == clipType)
|
2018-10-23 14:57:47 +00:00
|
|
|
return "poseId";
|
2018-10-25 00:19:38 +00:00
|
|
|
if (MotionClipType::Interpolation == clipType)
|
2018-10-23 14:57:47 +00:00
|
|
|
return "InterpolationType";
|
2019-09-21 14:30:27 +00:00
|
|
|
if (MotionClipType::ProceduralAnimation == clipType)
|
|
|
|
return "ProceduralAnimation";
|
2018-10-25 00:19:38 +00:00
|
|
|
if (MotionClipType::Motion == clipType)
|
2018-10-23 14:57:47 +00:00
|
|
|
return "motionId";
|
|
|
|
return "poseId";
|
|
|
|
}
|
|
|
|
QString linkData() const
|
|
|
|
{
|
2018-10-25 00:19:38 +00:00
|
|
|
if (MotionClipType::Pose == clipType)
|
2018-10-23 14:57:47 +00:00
|
|
|
return linkToId.toString();
|
2018-10-25 00:19:38 +00:00
|
|
|
if (MotionClipType::Interpolation == clipType)
|
2018-10-23 14:57:47 +00:00
|
|
|
return InterpolationTypeToString(interpolationType);
|
2019-09-21 14:30:27 +00:00
|
|
|
if (MotionClipType::ProceduralAnimation == clipType)
|
|
|
|
return ProceduralAnimationToString(proceduralAnimation);
|
2018-10-25 00:19:38 +00:00
|
|
|
if (MotionClipType::Motion == clipType)
|
2018-10-23 14:57:47 +00:00
|
|
|
return linkToId.toString();
|
|
|
|
return linkToId.toString();
|
|
|
|
}
|
|
|
|
float duration = 0.0;
|
2018-10-25 00:19:38 +00:00
|
|
|
MotionClipType clipType = MotionClipType::Pose;
|
2018-10-23 14:57:47 +00:00
|
|
|
QUuid linkToId;
|
|
|
|
InterpolationType interpolationType;
|
2019-09-21 14:30:27 +00:00
|
|
|
ProceduralAnimation proceduralAnimation;
|
2018-10-23 14:57:47 +00:00
|
|
|
};
|
|
|
|
|
2018-10-25 00:19:38 +00:00
|
|
|
class Motion
|
2018-10-02 04:59:30 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-10-25 00:19:38 +00:00
|
|
|
Motion()
|
2018-10-02 04:59:30 +00:00
|
|
|
{
|
|
|
|
}
|
2018-10-25 00:19:38 +00:00
|
|
|
~Motion()
|
2018-10-23 14:57:47 +00:00
|
|
|
{
|
|
|
|
releasePreviewMeshs();
|
|
|
|
}
|
2018-10-02 04:59:30 +00:00
|
|
|
QUuid id;
|
|
|
|
QString name;
|
|
|
|
bool dirty = true;
|
2018-10-25 00:19:38 +00:00
|
|
|
std::vector<MotionClip> clips;
|
2018-10-23 14:57:47 +00:00
|
|
|
std::vector<std::pair<float, JointNodeTree>> jointNodeTrees;
|
|
|
|
void updatePreviewMeshs(std::vector<std::pair<float, MeshLoader *>> &previewMeshs)
|
|
|
|
{
|
|
|
|
releasePreviewMeshs();
|
|
|
|
m_previewMeshs = previewMeshs;
|
|
|
|
previewMeshs.clear();
|
|
|
|
}
|
|
|
|
MeshLoader *takePreviewMesh() const
|
|
|
|
{
|
|
|
|
if (m_previewMeshs.empty())
|
|
|
|
return nullptr;
|
2018-11-09 03:20:48 +00:00
|
|
|
int middle = std::max((int)m_previewMeshs.size() / 2 - 1, (int)0);
|
|
|
|
return new MeshLoader(*m_previewMeshs[middle].second);
|
2018-10-23 14:57:47 +00:00
|
|
|
}
|
2018-10-02 04:59:30 +00:00
|
|
|
private:
|
2018-10-25 00:19:38 +00:00
|
|
|
Q_DISABLE_COPY(Motion);
|
2018-10-23 14:57:47 +00:00
|
|
|
void releasePreviewMeshs()
|
|
|
|
{
|
|
|
|
for (const auto &item: m_previewMeshs) {
|
|
|
|
delete item.second;
|
|
|
|
}
|
|
|
|
m_previewMeshs.clear();
|
|
|
|
}
|
|
|
|
std::vector<std::pair<float, MeshLoader *>> m_previewMeshs;
|
2018-10-02 04:59:30 +00:00
|
|
|
};
|
|
|
|
|
2018-10-25 00:19:38 +00:00
|
|
|
class MaterialMap
|
2018-10-09 02:19:12 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
TextureType forWhat;
|
|
|
|
QUuid imageId;
|
|
|
|
};
|
|
|
|
|
2018-10-25 00:19:38 +00:00
|
|
|
class MaterialLayer
|
2018-10-09 02:19:12 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-10-25 00:19:38 +00:00
|
|
|
std::vector<MaterialMap> maps;
|
2019-11-03 00:15:20 +00:00
|
|
|
float tileScale = 1.0;
|
2018-10-09 02:19:12 +00:00
|
|
|
};
|
|
|
|
|
2018-10-25 00:19:38 +00:00
|
|
|
class Material
|
2018-10-09 02:19:12 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-10-25 00:19:38 +00:00
|
|
|
Material()
|
2018-10-09 02:19:12 +00:00
|
|
|
{
|
|
|
|
}
|
2018-10-25 00:19:38 +00:00
|
|
|
~Material()
|
2018-10-09 02:19:12 +00:00
|
|
|
{
|
|
|
|
delete m_previewMesh;
|
|
|
|
}
|
|
|
|
QUuid id;
|
|
|
|
QString name;
|
|
|
|
bool dirty = true;
|
2018-10-25 00:19:38 +00:00
|
|
|
std::vector<MaterialLayer> layers;
|
2018-10-09 02:19:12 +00:00
|
|
|
void updatePreviewMesh(MeshLoader *previewMesh)
|
|
|
|
{
|
|
|
|
delete m_previewMesh;
|
|
|
|
m_previewMesh = previewMesh;
|
|
|
|
}
|
|
|
|
MeshLoader *takePreviewMesh() const
|
|
|
|
{
|
|
|
|
if (nullptr == m_previewMesh)
|
|
|
|
return nullptr;
|
|
|
|
return new MeshLoader(*m_previewMesh);
|
|
|
|
}
|
|
|
|
private:
|
2018-10-25 00:19:38 +00:00
|
|
|
Q_DISABLE_COPY(Material);
|
2018-10-09 02:19:12 +00:00
|
|
|
MeshLoader *m_previewMesh = nullptr;
|
|
|
|
};
|
|
|
|
|
2018-10-25 00:19:38 +00:00
|
|
|
enum class DocumentToSnapshotFor
|
2018-09-21 07:10:18 +00:00
|
|
|
{
|
|
|
|
Document = 0,
|
|
|
|
Nodes,
|
2018-10-09 02:19:12 +00:00
|
|
|
Materials,
|
2018-10-02 04:59:30 +00:00
|
|
|
Poses,
|
|
|
|
Motions
|
2018-09-21 07:10:18 +00:00
|
|
|
};
|
|
|
|
|
2018-11-03 08:09:42 +00:00
|
|
|
class Document : public SkeletonDocument
|
2018-04-07 08:44:39 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
signals:
|
|
|
|
void partAdded(QUuid partId);
|
|
|
|
void nodeAdded(QUuid nodeId);
|
|
|
|
void edgeAdded(QUuid edgeId);
|
|
|
|
void partRemoved(QUuid partId);
|
2018-08-27 08:50:40 +00:00
|
|
|
void componentNameChanged(QUuid componentId);
|
|
|
|
void componentChildrenChanged(QUuid componentId);
|
|
|
|
void componentRemoved(QUuid componentId);
|
|
|
|
void componentAdded(QUuid componentId);
|
|
|
|
void componentExpandStateChanged(QUuid componentId);
|
2018-09-06 15:04:59 +00:00
|
|
|
void componentSmoothAllChanged(QUuid componentId);
|
|
|
|
void componentSmoothSeamChanged(QUuid componentId);
|
2018-04-07 08:44:39 +00:00
|
|
|
void nodeRemoved(QUuid nodeId);
|
|
|
|
void edgeRemoved(QUuid edgeId);
|
|
|
|
void nodeRadiusChanged(QUuid nodeId);
|
2018-09-14 09:45:05 +00:00
|
|
|
void nodeBoneMarkChanged(QUuid nodeId);
|
2019-07-08 22:36:07 +00:00
|
|
|
void nodeColorStateChanged(QUuid nodeId);
|
|
|
|
void nodeCutRotationChanged(QUuid nodeId);
|
|
|
|
void nodeCutFaceChanged(QUuid nodeId);
|
2018-04-07 08:44:39 +00:00
|
|
|
void nodeOriginChanged(QUuid nodeId);
|
|
|
|
void edgeChanged(QUuid edgeId);
|
|
|
|
void partPreviewChanged(QUuid partId);
|
|
|
|
void resultMeshChanged();
|
|
|
|
void turnaroundChanged();
|
|
|
|
void editModeChanged();
|
2019-08-17 10:13:11 +00:00
|
|
|
void paintModeChanged();
|
2018-04-07 08:44:39 +00:00
|
|
|
void skeletonChanged();
|
2019-03-17 14:04:12 +00:00
|
|
|
//void resultSkeletonChanged();
|
2018-05-07 16:08:19 +00:00
|
|
|
void resultTextureChanged();
|
2019-03-17 14:04:12 +00:00
|
|
|
//void resultBakedTextureChanged();
|
2018-05-07 16:08:19 +00:00
|
|
|
void postProcessedResultChanged();
|
2018-09-14 09:45:05 +00:00
|
|
|
void resultRigChanged();
|
|
|
|
void rigChanged();
|
2018-04-08 01:30:55 +00:00
|
|
|
void partLockStateChanged(QUuid partId);
|
|
|
|
void partVisibleStateChanged(QUuid partId);
|
|
|
|
void partSubdivStateChanged(QUuid partId);
|
2018-04-11 09:19:27 +00:00
|
|
|
void partDisableStateChanged(QUuid partId);
|
2018-04-15 12:11:51 +00:00
|
|
|
void partXmirrorStateChanged(QUuid partId);
|
2019-03-17 14:04:12 +00:00
|
|
|
//void partZmirrorStateChanged(QUuid partId);
|
2019-05-20 13:38:01 +00:00
|
|
|
void partBaseChanged(QUuid partId);
|
2018-04-17 16:14:31 +00:00
|
|
|
void partDeformThicknessChanged(QUuid partId);
|
|
|
|
void partDeformWidthChanged(QUuid partId);
|
2019-08-03 10:21:27 +00:00
|
|
|
void partDeformMapImageIdChanged(QUuid partId);
|
|
|
|
void partDeformMapScaleChanged(QUuid partId);
|
2018-04-26 02:23:22 +00:00
|
|
|
void partRoundStateChanged(QUuid partId);
|
|
|
|
void partColorStateChanged(QUuid partId);
|
2019-02-21 22:48:15 +00:00
|
|
|
void partCutRotationChanged(QUuid partId);
|
2019-05-05 12:49:26 +00:00
|
|
|
void partCutFaceChanged(QUuid partId);
|
2018-10-09 02:19:12 +00:00
|
|
|
void partMaterialIdChanged(QUuid partId);
|
2019-03-09 22:10:39 +00:00
|
|
|
void partChamferStateChanged(QUuid partId);
|
2019-05-19 03:21:38 +00:00
|
|
|
void partTargetChanged(QUuid partId);
|
2019-05-25 23:24:24 +00:00
|
|
|
void partColorSolubilityChanged(QUuid partId);
|
2019-08-18 12:02:39 +00:00
|
|
|
void partHollowThicknessChanged(QUuid partId);
|
2019-11-07 12:08:47 +00:00
|
|
|
void partCountershadeStateChanged(QUuid partId);
|
2019-12-14 13:28:14 +00:00
|
|
|
void partGridStateChanged(QUuid partId);
|
2018-11-14 13:21:45 +00:00
|
|
|
void componentCombineModeChanged(QUuid componentId);
|
2018-04-10 07:59:20 +00:00
|
|
|
void cleanup();
|
2019-07-20 04:34:53 +00:00
|
|
|
void cleanupScript();
|
2018-04-15 12:11:51 +00:00
|
|
|
void originChanged();
|
2018-04-16 22:54:41 +00:00
|
|
|
void xlockStateChanged();
|
|
|
|
void ylockStateChanged();
|
|
|
|
void zlockStateChanged();
|
2018-09-08 04:20:31 +00:00
|
|
|
void radiusLockStateChanged();
|
2018-04-18 01:49:23 +00:00
|
|
|
void checkPart(QUuid partId);
|
|
|
|
void partChecked(QUuid partId);
|
|
|
|
void partUnchecked(QUuid partId);
|
2018-04-26 02:23:22 +00:00
|
|
|
void enableBackgroundBlur();
|
|
|
|
void disableBackgroundBlur();
|
2018-05-07 16:08:19 +00:00
|
|
|
void exportReady();
|
2018-05-12 10:07:46 +00:00
|
|
|
void uncheckAll();
|
|
|
|
void checkNode(QUuid nodeId);
|
|
|
|
void checkEdge(QUuid edgeId);
|
2018-08-27 08:50:40 +00:00
|
|
|
void optionsChanged();
|
2018-09-14 09:45:05 +00:00
|
|
|
void rigTypeChanged();
|
2018-10-23 14:57:47 +00:00
|
|
|
void posesChanged();
|
|
|
|
void motionsChanged();
|
2018-09-21 07:10:18 +00:00
|
|
|
void poseAdded(QUuid poseId);
|
|
|
|
void poseRemoved(QUuid);
|
|
|
|
void poseListChanged();
|
|
|
|
void poseNameChanged(QUuid poseId);
|
2018-11-09 03:20:48 +00:00
|
|
|
void poseFramesChanged(QUuid poseId);
|
|
|
|
void poseTurnaroundImageIdChanged(QUuid poseId);
|
2019-06-19 12:57:38 +00:00
|
|
|
void poseYtranslationScaleChanged(QUuid poseId);
|
2018-09-21 07:10:18 +00:00
|
|
|
void posePreviewChanged(QUuid poseId);
|
2018-10-02 04:59:30 +00:00
|
|
|
void motionAdded(QUuid motionId);
|
|
|
|
void motionRemoved(QUuid motionId);
|
|
|
|
void motionListChanged();
|
|
|
|
void motionNameChanged(QUuid motionId);
|
2018-10-23 14:57:47 +00:00
|
|
|
void motionClipsChanged(QUuid motionId);
|
|
|
|
void motionPreviewChanged(QUuid motionId);
|
|
|
|
void motionResultChanged(QUuid motionId);
|
2018-10-09 02:19:12 +00:00
|
|
|
void materialAdded(QUuid materialId);
|
|
|
|
void materialRemoved(QUuid materialId);
|
|
|
|
void materialListChanged();
|
|
|
|
void materialNameChanged(QUuid materialId);
|
|
|
|
void materialLayersChanged(QUuid materialId);
|
|
|
|
void materialPreviewChanged(QUuid materialId);
|
|
|
|
void meshGenerating();
|
|
|
|
void postProcessing();
|
|
|
|
void textureGenerating();
|
2018-10-09 09:17:44 +00:00
|
|
|
void textureChanged();
|
2019-07-20 04:34:53 +00:00
|
|
|
void scriptChanged();
|
|
|
|
void scriptModifiedFromExternal();
|
|
|
|
void mergedVaraiblesChanged();
|
|
|
|
void scriptRunning();
|
|
|
|
void scriptErrorChanged();
|
|
|
|
void scriptConsoleLogChanged();
|
2019-08-08 11:24:33 +00:00
|
|
|
void mouseTargetChanged();
|
2019-08-17 10:13:11 +00:00
|
|
|
void mousePickRadiusChanged();
|
2018-04-15 12:11:51 +00:00
|
|
|
public: // need initialize
|
2018-05-07 16:08:19 +00:00
|
|
|
QImage *textureGuideImage;
|
|
|
|
QImage *textureImage;
|
|
|
|
QImage *textureBorderImage;
|
2018-05-10 09:16:22 +00:00
|
|
|
QImage *textureColorImage;
|
2018-11-15 22:56:24 +00:00
|
|
|
QImage *textureNormalImage;
|
|
|
|
QImage *textureMetalnessRoughnessAmbientOcclusionImage;
|
2018-11-28 03:00:03 +00:00
|
|
|
QImage *textureMetalnessImage;
|
|
|
|
QImage *textureRoughnessImage;
|
|
|
|
QImage *textureAmbientOcclusionImage;
|
2018-09-14 09:45:05 +00:00
|
|
|
RigType rigType;
|
2018-09-22 10:31:02 +00:00
|
|
|
bool weldEnabled;
|
2018-04-07 08:44:39 +00:00
|
|
|
public:
|
2018-10-25 00:19:38 +00:00
|
|
|
Document();
|
|
|
|
~Document();
|
|
|
|
std::map<QUuid, Component> componentMap;
|
|
|
|
std::map<QUuid, Material> materialMap;
|
2018-10-09 02:19:12 +00:00
|
|
|
std::vector<QUuid> materialIdList;
|
2018-10-25 00:19:38 +00:00
|
|
|
std::map<QUuid, Pose> poseMap;
|
2018-09-21 07:10:18 +00:00
|
|
|
std::vector<QUuid> poseIdList;
|
2018-10-25 00:19:38 +00:00
|
|
|
std::map<QUuid, Motion> motionMap;
|
2018-10-02 04:59:30 +00:00
|
|
|
std::vector<QUuid> motionIdList;
|
2018-10-25 00:19:38 +00:00
|
|
|
Component rootComponent;
|
2018-04-15 12:11:51 +00:00
|
|
|
QImage preview;
|
2018-11-03 08:09:42 +00:00
|
|
|
bool undoable() const override;
|
|
|
|
bool redoable() const override;
|
|
|
|
bool hasPastableNodesInClipboard() const override;
|
|
|
|
bool originSettled() const override;
|
|
|
|
bool isNodeEditable(QUuid nodeId) const override;
|
|
|
|
bool isEdgeEditable(QUuid edgeId) const override;
|
|
|
|
void copyNodes(std::set<QUuid> nodeIdSet) const override;
|
2018-10-25 00:19:38 +00:00
|
|
|
void toSnapshot(Snapshot *snapshot, const std::set<QUuid> &limitNodeIds=std::set<QUuid>(),
|
|
|
|
DocumentToSnapshotFor forWhat=DocumentToSnapshotFor::Document,
|
2018-10-02 04:59:30 +00:00
|
|
|
const std::set<QUuid> &limitPoseIds=std::set<QUuid>(),
|
2018-10-09 02:19:12 +00:00
|
|
|
const std::set<QUuid> &limitMotionIds=std::set<QUuid>(),
|
|
|
|
const std::set<QUuid> &limitMaterialIds=std::set<QUuid>()) const;
|
2018-10-25 00:19:38 +00:00
|
|
|
void fromSnapshot(const Snapshot &snapshot);
|
|
|
|
void addFromSnapshot(const Snapshot &snapshot, bool fromPaste=true);
|
|
|
|
const Component *findComponent(QUuid componentId) const;
|
|
|
|
const Component *findComponentParent(QUuid componentId) const;
|
2018-08-27 08:50:40 +00:00
|
|
|
QUuid findComponentParentId(QUuid componentId) const;
|
2018-10-25 00:19:38 +00:00
|
|
|
const Material *findMaterial(QUuid materialId) const;
|
|
|
|
const Pose *findPose(QUuid poseId) const;
|
|
|
|
const Motion *findMotion(QUuid motionId) const;
|
2018-05-07 17:16:58 +00:00
|
|
|
MeshLoader *takeResultMesh();
|
2019-01-07 13:03:42 +00:00
|
|
|
bool isMeshGenerationSucceed();
|
2018-05-10 09:16:22 +00:00
|
|
|
MeshLoader *takeResultTextureMesh();
|
2018-09-14 09:45:05 +00:00
|
|
|
MeshLoader *takeResultRigWeightMesh();
|
2018-10-26 23:04:45 +00:00
|
|
|
const std::vector<RiggerBone> *resultRigBones() const;
|
|
|
|
const std::map<int, RiggerVertexWeights> *resultRigWeights() const;
|
2018-04-07 08:44:39 +00:00
|
|
|
void updateTurnaround(const QImage &image);
|
2018-08-27 08:50:40 +00:00
|
|
|
void setSharedContextWidget(QOpenGLWidget *sharedContextWidget);
|
2018-10-09 02:19:12 +00:00
|
|
|
bool hasPastableMaterialsInClipboard() const;
|
2018-09-21 07:10:18 +00:00
|
|
|
bool hasPastablePosesInClipboard() const;
|
2018-10-02 04:59:30 +00:00
|
|
|
bool hasPastableMotionsInClipboard() const;
|
2018-10-26 23:04:45 +00:00
|
|
|
const Outcome ¤tPostProcessedOutcome() const;
|
2018-05-07 16:08:19 +00:00
|
|
|
bool isExportReady() const;
|
2018-08-27 08:50:40 +00:00
|
|
|
bool isPostProcessResultObsolete() const;
|
|
|
|
void collectComponentDescendantParts(QUuid componentId, std::vector<QUuid> &partIds) const;
|
2018-09-07 10:13:55 +00:00
|
|
|
void collectComponentDescendantComponents(QUuid componentId, std::vector<QUuid> &componentIds) const;
|
2018-11-06 16:26:19 +00:00
|
|
|
const std::vector<std::pair<QtMsgType, QString>> &resultRigMessages() const;
|
2018-10-26 23:04:45 +00:00
|
|
|
const Outcome ¤tRiggedOutcome() const;
|
2018-10-02 04:59:30 +00:00
|
|
|
bool currentRigSucceed() const;
|
2018-10-09 13:01:04 +00:00
|
|
|
bool isMeshGenerating() const;
|
2019-07-20 04:34:53 +00:00
|
|
|
const QString &script() const;
|
|
|
|
const std::map<QString, std::map<QString, QString>> &variables() const;
|
|
|
|
const QString &scriptError() const;
|
|
|
|
const QString &scriptConsoleLog() const;
|
2019-08-08 11:24:33 +00:00
|
|
|
const QVector3D &mouseTargetPosition() const;
|
2019-08-17 10:13:11 +00:00
|
|
|
float mousePickRadius() const;
|
2018-04-07 08:44:39 +00:00
|
|
|
public slots:
|
2018-11-03 08:09:42 +00:00
|
|
|
void undo() override;
|
|
|
|
void redo() override;
|
|
|
|
void paste() override;
|
2018-04-07 08:44:39 +00:00
|
|
|
void removeNode(QUuid nodeId);
|
|
|
|
void removeEdge(QUuid edgeId);
|
|
|
|
void removePart(QUuid partId);
|
2019-03-20 11:04:37 +00:00
|
|
|
void addNodeWithId(QUuid nodeId, float x, float y, float z, float radius, QUuid fromNodeId);
|
2018-04-07 08:44:39 +00:00
|
|
|
void addNode(float x, float y, float z, float radius, QUuid fromNodeId);
|
|
|
|
void scaleNodeByAddRadius(QUuid nodeId, float amount);
|
|
|
|
void moveNodeBy(QUuid nodeId, float x, float y, float z);
|
|
|
|
void setNodeOrigin(QUuid nodeId, float x, float y, float z);
|
|
|
|
void setNodeRadius(QUuid nodeId, float radius);
|
2018-10-25 00:19:38 +00:00
|
|
|
void setNodeBoneMark(QUuid nodeId, BoneMark mark);
|
2019-07-08 22:36:07 +00:00
|
|
|
void setNodeCutRotation(QUuid nodeId, float cutRotation);
|
|
|
|
void setNodeCutFace(QUuid nodeId, CutFace cutFace);
|
|
|
|
void setNodeCutFaceLinkedId(QUuid nodeId, QUuid linkedId);
|
|
|
|
void clearNodeCutFaceSettings(QUuid nodeId);
|
2018-06-21 08:24:18 +00:00
|
|
|
void switchNodeXZ(QUuid nodeId);
|
2018-04-15 12:11:51 +00:00
|
|
|
void moveOriginBy(float x, float y, float z);
|
2018-04-07 08:44:39 +00:00
|
|
|
void addEdge(QUuid fromNodeId, QUuid toNodeId);
|
2018-11-03 08:09:42 +00:00
|
|
|
void setEditMode(SkeletonDocumentEditMode mode);
|
2019-08-17 10:13:11 +00:00
|
|
|
void setPaintMode(PaintMode mode);
|
|
|
|
void setMousePickRadius(float radius);
|
2019-12-14 13:28:14 +00:00
|
|
|
void createGriddedPartsFromNodes(const std::set<QUuid> &nodeIds);
|
|
|
|
void createFromNodesAndEdges(const std::vector<QVector3D> &nodes,
|
|
|
|
const std::vector<std::pair<size_t, size_t>> &edges);
|
|
|
|
void createSinglePartFromEdges(const std::vector<QVector3D> &nodes,
|
|
|
|
const std::vector<std::pair<size_t, size_t>> &edges);
|
2018-04-07 08:44:39 +00:00
|
|
|
void uiReady();
|
|
|
|
void generateMesh();
|
2018-08-27 08:50:40 +00:00
|
|
|
void regenerateMesh();
|
2018-04-07 08:44:39 +00:00
|
|
|
void meshReady();
|
2018-05-07 16:08:19 +00:00
|
|
|
void generateTexture();
|
|
|
|
void textureReady();
|
|
|
|
void postProcess();
|
|
|
|
void postProcessedMeshResultReady();
|
2018-09-14 09:45:05 +00:00
|
|
|
void generateRig();
|
|
|
|
void rigReady();
|
2018-09-21 07:10:18 +00:00
|
|
|
void generatePosePreviews();
|
|
|
|
void posePreviewsReady();
|
2018-10-09 02:19:12 +00:00
|
|
|
void generateMaterialPreviews();
|
|
|
|
void materialPreviewsReady();
|
2018-10-23 14:57:47 +00:00
|
|
|
void generateMotions();
|
|
|
|
void motionsReady();
|
2019-08-08 11:24:33 +00:00
|
|
|
void pickMouseTarget(const QVector3D &nearPosition, const QVector3D &farPosition);
|
2019-08-17 10:13:11 +00:00
|
|
|
void doPickMouseTarget();
|
2019-08-08 11:24:33 +00:00
|
|
|
void mouseTargetReady();
|
2018-04-08 01:30:55 +00:00
|
|
|
void setPartLockState(QUuid partId, bool locked);
|
|
|
|
void setPartVisibleState(QUuid partId, bool visible);
|
|
|
|
void setPartSubdivState(QUuid partId, bool subdived);
|
2018-04-11 09:19:27 +00:00
|
|
|
void setPartDisableState(QUuid partId, bool disabled);
|
2018-04-15 12:11:51 +00:00
|
|
|
void setPartXmirrorState(QUuid partId, bool mirrored);
|
2019-03-17 14:04:12 +00:00
|
|
|
//void setPartZmirrorState(QUuid partId, bool mirrored);
|
2019-05-20 13:38:01 +00:00
|
|
|
void setPartBase(QUuid partId, PartBase base);
|
2018-04-17 16:14:31 +00:00
|
|
|
void setPartDeformThickness(QUuid partId, float thickness);
|
|
|
|
void setPartDeformWidth(QUuid partId, float width);
|
2019-08-03 10:21:27 +00:00
|
|
|
void setPartDeformMapImageId(QUuid partId, QUuid imageId);
|
|
|
|
void setPartDeformMapScale(QUuid partId, float scale);
|
2018-04-26 02:23:22 +00:00
|
|
|
void setPartRoundState(QUuid partId, bool rounded);
|
|
|
|
void setPartColorState(QUuid partId, bool hasColor, QColor color);
|
2019-02-21 22:48:15 +00:00
|
|
|
void setPartCutRotation(QUuid partId, float cutRotation);
|
2019-05-05 12:49:26 +00:00
|
|
|
void setPartCutFace(QUuid partId, CutFace cutFace);
|
2019-05-19 03:21:38 +00:00
|
|
|
void setPartCutFaceLinkedId(QUuid partId, QUuid linkedId);
|
2018-10-09 02:19:12 +00:00
|
|
|
void setPartMaterialId(QUuid partId, QUuid materialId);
|
2019-03-09 22:10:39 +00:00
|
|
|
void setPartChamferState(QUuid partId, bool chamfered);
|
2019-05-19 03:21:38 +00:00
|
|
|
void setPartTarget(QUuid partId, PartTarget target);
|
2019-05-25 23:24:24 +00:00
|
|
|
void setPartColorSolubility(QUuid partId, float solubility);
|
2019-08-18 12:02:39 +00:00
|
|
|
void setPartHollowThickness(QUuid partId, float hollowThickness);
|
2019-11-07 12:08:47 +00:00
|
|
|
void setPartCountershaded(QUuid partId, bool countershaded);
|
2018-11-14 13:21:45 +00:00
|
|
|
void setComponentCombineMode(QUuid componentId, CombineMode combineMode);
|
2018-08-27 08:50:40 +00:00
|
|
|
void moveComponentUp(QUuid componentId);
|
|
|
|
void moveComponentDown(QUuid componentId);
|
|
|
|
void moveComponentToTop(QUuid componentId);
|
|
|
|
void moveComponentToBottom(QUuid componentId);
|
|
|
|
void renameComponent(QUuid componentId, QString name);
|
|
|
|
void removeComponent(QUuid componentId);
|
|
|
|
void addComponent(QUuid parentId);
|
|
|
|
void moveComponent(QUuid componentId, QUuid toParentId);
|
|
|
|
void setCurrentCanvasComponentId(QUuid componentId);
|
|
|
|
void createNewComponentAndMoveThisIn(QUuid componentId);
|
2018-09-07 10:13:55 +00:00
|
|
|
void createNewChildComponent(QUuid parentComponentId);
|
2018-08-27 08:50:40 +00:00
|
|
|
void setComponentExpandState(QUuid componentId, bool expanded);
|
2018-09-06 15:04:59 +00:00
|
|
|
void setComponentSmoothAll(QUuid componentId, float toSmoothAll);
|
|
|
|
void setComponentSmoothSeam(QUuid componentId, float toSmoothSeam);
|
2018-08-27 08:50:40 +00:00
|
|
|
void hideOtherComponents(QUuid componentId);
|
|
|
|
void lockOtherComponents(QUuid componentId);
|
|
|
|
void hideAllComponents();
|
|
|
|
void showAllComponents();
|
2019-10-19 00:31:27 +00:00
|
|
|
void showOrHideAllComponents();
|
2018-08-27 08:50:40 +00:00
|
|
|
void collapseAllComponents();
|
|
|
|
void expandAllComponents();
|
|
|
|
void lockAllComponents();
|
|
|
|
void unlockAllComponents();
|
|
|
|
void hideDescendantComponents(QUuid componentId);
|
|
|
|
void showDescendantComponents(QUuid componentId);
|
|
|
|
void lockDescendantComponents(QUuid componentId);
|
|
|
|
void unlockDescendantComponents(QUuid componentId);
|
2018-04-08 23:34:46 +00:00
|
|
|
void saveSnapshot();
|
2018-04-09 14:24:30 +00:00
|
|
|
void batchChangeBegin();
|
|
|
|
void batchChangeEnd();
|
2018-04-10 07:59:20 +00:00
|
|
|
void reset();
|
2019-07-20 04:34:53 +00:00
|
|
|
void resetScript();
|
2018-10-25 06:27:59 +00:00
|
|
|
void clearHistories();
|
|
|
|
void silentReset();
|
2019-07-20 04:34:53 +00:00
|
|
|
void silentResetScript();
|
2018-04-12 12:27:21 +00:00
|
|
|
void breakEdge(QUuid edgeId);
|
2018-04-16 22:54:41 +00:00
|
|
|
void setXlockState(bool locked);
|
|
|
|
void setYlockState(bool locked);
|
|
|
|
void setZlockState(bool locked);
|
2018-09-08 04:20:31 +00:00
|
|
|
void setRadiusLockState(bool locked);
|
2018-09-03 07:05:05 +00:00
|
|
|
void enableAllPositionRelatedLocks();
|
|
|
|
void disableAllPositionRelatedLocks();
|
2018-09-07 12:51:33 +00:00
|
|
|
void toggleSmoothNormal();
|
2018-09-22 10:31:02 +00:00
|
|
|
void enableWeld(bool enabled);
|
2018-09-14 09:45:05 +00:00
|
|
|
void setRigType(RigType toRigType);
|
2018-11-09 15:07:26 +00:00
|
|
|
void addPose(QUuid poseId, QString name, std::vector<std::pair<std::map<QString, QString>, std::map<QString, std::map<QString, QString>>>> frames,
|
2019-06-19 12:57:38 +00:00
|
|
|
QUuid turnaroundImageId,
|
|
|
|
float yTranslationScale);
|
2018-09-21 07:10:18 +00:00
|
|
|
void removePose(QUuid poseId);
|
2018-11-09 03:20:48 +00:00
|
|
|
void setPoseFrames(QUuid poseId, std::vector<std::pair<std::map<QString, QString>, std::map<QString, std::map<QString, QString>>>> frames);
|
|
|
|
void setPoseTurnaroundImageId(QUuid poseId, QUuid imageId);
|
2019-06-19 12:57:38 +00:00
|
|
|
void setPoseYtranslationScale(QUuid poseId, float scale);
|
2018-09-21 07:10:18 +00:00
|
|
|
void renamePose(QUuid poseId, QString name);
|
2018-11-09 15:07:26 +00:00
|
|
|
void addMotion(QUuid motionId, QString name, std::vector<MotionClip> clips);
|
2018-10-02 04:59:30 +00:00
|
|
|
void removeMotion(QUuid motionId);
|
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);
|
2018-11-09 15:07:26 +00:00
|
|
|
void addMaterial(QUuid materialId, QString name, std::vector<MaterialLayer>);
|
2018-10-09 02:19:12 +00:00
|
|
|
void removeMaterial(QUuid materialId);
|
2018-10-25 00:19:38 +00:00
|
|
|
void setMaterialLayers(QUuid materialId, std::vector<MaterialLayer> layers);
|
2018-10-09 02:19:12 +00:00
|
|
|
void renameMaterial(QUuid materialId, QString name);
|
2019-06-01 13:12:53 +00:00
|
|
|
void applyPreferencePartColorChange();
|
|
|
|
void applyPreferenceFlatShadingChange();
|
2019-07-20 04:34:53 +00:00
|
|
|
void initScript(const QString &script);
|
|
|
|
void updateScript(const QString &script);
|
|
|
|
void runScript();
|
|
|
|
void scriptResultReady();
|
|
|
|
void updateVariable(const QString &name, const std::map<QString, QString> &value);
|
|
|
|
void updateVariableValue(const QString &name, const QString &value);
|
2019-08-18 01:13:48 +00:00
|
|
|
void startPaint(void);
|
|
|
|
void stopPaint(void);
|
2019-08-17 10:13:11 +00:00
|
|
|
void setMousePickMaskNodeIds(const std::set<QUuid> &nodeIds);
|
2018-04-07 08:44:39 +00:00
|
|
|
private:
|
|
|
|
void splitPartByNode(std::vector<std::vector<QUuid>> *groups, QUuid nodeId);
|
|
|
|
void joinNodeAndNeiborsToGroup(std::vector<QUuid> *group, QUuid nodeId, std::set<QUuid> *visitMap, QUuid noUseEdgeId=QUuid());
|
|
|
|
void splitPartByEdge(std::vector<std::vector<QUuid>> *groups, QUuid edgeId);
|
2018-04-13 00:19:31 +00:00
|
|
|
bool isPartReadonly(QUuid partId) const;
|
2019-03-20 11:04:37 +00:00
|
|
|
QUuid createNode(QUuid nodeId, float x, float y, float z, float radius, QUuid fromNodeId);
|
2018-04-15 12:11:51 +00:00
|
|
|
void settleOrigin();
|
2018-05-07 16:08:19 +00:00
|
|
|
void checkExportReadyState();
|
2018-08-27 08:50:40 +00:00
|
|
|
void removePartDontCareComponent(QUuid partId);
|
|
|
|
void addPartToComponent(QUuid partId, QUuid componentId);
|
|
|
|
bool isDescendantComponent(QUuid componentId, QUuid suspiciousId);
|
|
|
|
void removeComponentRecursively(QUuid componentId);
|
|
|
|
void resetDirtyFlags();
|
|
|
|
void markAllDirty();
|
2018-09-14 09:45:05 +00:00
|
|
|
void removeRigResults();
|
2019-05-19 03:21:38 +00:00
|
|
|
void updateLinkedPart(QUuid oldPartId, QUuid newPartId);
|
2019-07-07 06:27:58 +00:00
|
|
|
//void addToolToMesh(MeshLoader *mesh);
|
2019-07-26 01:20:32 +00:00
|
|
|
bool updateDefaultVariables(const std::map<QString, std::map<QString, QString>> &defaultVariables);
|
2019-12-14 13:28:14 +00:00
|
|
|
void checkPartGrid(QUuid partId);
|
2018-04-15 12:11:51 +00:00
|
|
|
private: // need initialize
|
2018-08-27 08:50:40 +00:00
|
|
|
bool m_isResultMeshObsolete;
|
2018-04-07 08:44:39 +00:00
|
|
|
MeshGenerator *m_meshGenerator;
|
2018-05-07 17:16:58 +00:00
|
|
|
MeshLoader *m_resultMesh;
|
2019-12-14 13:28:14 +00:00
|
|
|
std::map<QUuid, StrokeMeshBuilder::CutFaceTransform> *m_resultMeshCutFaceTransforms;
|
2019-07-07 06:27:58 +00:00
|
|
|
std::map<QUuid, std::map<QString, QVector2D>> *m_resultMeshNodesCutFaces;
|
2019-01-07 13:03:42 +00:00
|
|
|
bool m_isMeshGenerationSucceed;
|
2018-04-15 12:11:51 +00:00
|
|
|
int m_batchChangeRefCount;
|
2018-10-26 23:04:45 +00:00
|
|
|
Outcome *m_currentOutcome;
|
2018-08-27 08:50:40 +00:00
|
|
|
bool m_isTextureObsolete;
|
2018-05-07 16:08:19 +00:00
|
|
|
TextureGenerator *m_textureGenerator;
|
2018-08-27 08:50:40 +00:00
|
|
|
bool m_isPostProcessResultObsolete;
|
2018-05-07 16:08:19 +00:00
|
|
|
MeshResultPostProcessor *m_postProcessor;
|
2018-10-26 23:04:45 +00:00
|
|
|
Outcome *m_postProcessedOutcome;
|
2018-05-10 09:16:22 +00:00
|
|
|
MeshLoader *m_resultTextureMesh;
|
2018-05-11 05:27:29 +00:00
|
|
|
unsigned long long m_textureImageUpdateVersion;
|
2018-08-27 08:50:40 +00:00
|
|
|
QOpenGLWidget *m_sharedContextWidget;
|
|
|
|
QUuid m_currentCanvasComponentId;
|
2018-09-03 07:05:05 +00:00
|
|
|
bool m_allPositionRelatedLocksEnabled;
|
2018-09-07 12:51:33 +00:00
|
|
|
bool m_smoothNormal;
|
2018-09-14 09:45:05 +00:00
|
|
|
RigGenerator *m_rigGenerator;
|
|
|
|
MeshLoader *m_resultRigWeightMesh;
|
2018-10-26 23:04:45 +00:00
|
|
|
std::vector<RiggerBone> *m_resultRigBones;
|
|
|
|
std::map<int, RiggerVertexWeights> *m_resultRigWeights;
|
2018-09-14 09:45:05 +00:00
|
|
|
bool m_isRigObsolete;
|
2018-10-26 23:04:45 +00:00
|
|
|
Outcome *m_riggedOutcome;
|
2018-09-21 07:10:18 +00:00
|
|
|
PosePreviewsGenerator *m_posePreviewsGenerator;
|
2018-10-02 04:59:30 +00:00
|
|
|
bool m_currentRigSucceed;
|
2018-10-09 02:19:12 +00:00
|
|
|
MaterialPreviewsGenerator *m_materialPreviewsGenerator;
|
2018-10-23 14:57:47 +00:00
|
|
|
MotionsGenerator *m_motionsGenerator;
|
2019-07-10 12:09:46 +00:00
|
|
|
quint64 m_meshGenerationId;
|
|
|
|
quint64 m_nextMeshGenerationId;
|
2019-07-20 04:34:53 +00:00
|
|
|
std::map<QString, std::map<QString, QString>> m_cachedVariables;
|
|
|
|
std::map<QString, std::map<QString, QString>> m_mergedVariables;
|
|
|
|
ScriptRunner *m_scriptRunner;
|
|
|
|
bool m_isScriptResultObsolete;
|
2019-08-08 11:24:33 +00:00
|
|
|
MousePicker *m_mousePicker;
|
|
|
|
bool m_isMouseTargetResultObsolete;
|
2019-08-17 10:13:11 +00:00
|
|
|
PaintMode m_paintMode;
|
|
|
|
float m_mousePickRadius;
|
2019-08-18 01:13:48 +00:00
|
|
|
bool m_saveNextPaintSnapshot;
|
2018-04-15 12:11:51 +00:00
|
|
|
private:
|
2018-04-08 23:34:46 +00:00
|
|
|
static unsigned long m_maxSnapshot;
|
2018-10-25 00:19:38 +00:00
|
|
|
std::deque<HistoryItem> m_undoItems;
|
|
|
|
std::deque<HistoryItem> m_redoItems;
|
2018-08-27 08:50:40 +00:00
|
|
|
GeneratedCacheContext m_generatedCacheContext;
|
2018-11-06 16:26:19 +00:00
|
|
|
std::vector<std::pair<QtMsgType, QString>> m_resultRigMessages;
|
2019-08-17 10:13:11 +00:00
|
|
|
QVector3D m_mouseRayNear;
|
|
|
|
QVector3D m_mouseRayFar;
|
|
|
|
QVector3D m_mouseTargetPosition;
|
|
|
|
QString m_scriptError;
|
|
|
|
QString m_scriptConsoleLog;
|
|
|
|
QString m_script;
|
|
|
|
std::set<QUuid> m_mousePickMaskNodeIds;
|
2019-08-18 01:13:48 +00:00
|
|
|
std::set<QUuid> m_intermediatePaintImageIds;
|
2018-04-07 08:44:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|