Fix document reset
parent
ce128bff1e
commit
8b8579d02e
|
@ -67,9 +67,18 @@ void BoneGenerator::process()
|
|||
previewTriangleNormals,
|
||||
0,
|
||||
&previewTriangleVertexNormals);
|
||||
std::vector<std::tuple<dust3d::Color, float /*metalness*/, float /*roughness*/>> vertexProperties(it.second.vertexColors.size());
|
||||
for (size_t i = 0; i < vertexProperties.size(); ++i) {
|
||||
vertexProperties[i] = std::make_tuple(it.second.vertexColors[i],
|
||||
(float)0.0, (float)1.0);
|
||||
}
|
||||
(*m_bonePreviewMeshes)[it.first] = std::make_unique<ModelMesh>(it.second.vertices,
|
||||
it.second.triangles,
|
||||
previewTriangleVertexNormals);
|
||||
previewTriangleVertexNormals,
|
||||
dust3d::Color::createWhite(),
|
||||
(float)0.0,
|
||||
(float)1.0,
|
||||
&vertexProperties);
|
||||
}
|
||||
|
||||
qDebug() << "The bone generation took" << countTimeConsumed.elapsed() << "milliseconds";
|
||||
|
|
|
@ -2058,6 +2058,8 @@ void Document::silentReset()
|
|||
partMap.clear();
|
||||
componentMap.clear();
|
||||
rootComponent = Document::Component();
|
||||
boneMap.clear();
|
||||
boneIdList.clear();
|
||||
}
|
||||
|
||||
void Document::reset()
|
||||
|
|
|
@ -171,6 +171,7 @@ void BoneGenerator::addBonePreviewTriangle(BonePreview& bonePreview,
|
|||
oldToNewVertexMap.insert(std::make_pair(triangle[i], bonePreview.vertices.size()));
|
||||
newTriangle[i] = bonePreview.vertices.size();
|
||||
bonePreview.vertices.push_back(m_vertices[triangle[i]]);
|
||||
bonePreview.vertexColors.push_back(Color(1.0, 1.0, 1.0));
|
||||
} else {
|
||||
newTriangle[i] = findVertex->second;
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ public:
|
|||
struct BonePreview {
|
||||
std::vector<Vector3> vertices;
|
||||
std::vector<std::vector<size_t>> triangles;
|
||||
std::vector<Color> vertexColors;
|
||||
};
|
||||
|
||||
BoneGenerator();
|
||||
|
|
Loading…
Reference in New Issue