diff --git a/src/skeletondocument.cpp b/src/skeletondocument.cpp index fc1a5372..56221e87 100644 --- a/src/skeletondocument.cpp +++ b/src/skeletondocument.cpp @@ -577,11 +577,15 @@ void SkeletonDocument::fromSnapshot(const SkeletonSnapshot &snapshot) edge.partId = QUuid(valueOfKeyInMapOrEmpty(edgeKv.second, "partId")); edge.branchMode = SkeletonEdgeBranchModeFromString(valueOfKeyInMapOrEmpty(edgeKv.second, "branchMode")); QString fromNodeId = valueOfKeyInMapOrEmpty(edgeKv.second, "from"); - if (!fromNodeId.isEmpty()) + if (!fromNodeId.isEmpty()) { edge.nodeIds.push_back(QUuid(fromNodeId)); + nodeMap[QUuid(fromNodeId)].edgeIds.push_back(edge.id); + } QString toNodeId = valueOfKeyInMapOrEmpty(edgeKv.second, "to"); - if (!toNodeId.isEmpty()) + if (!toNodeId.isEmpty()) { edge.nodeIds.push_back(QUuid(toNodeId)); + nodeMap[QUuid(toNodeId)].edgeIds.push_back(edge.id); + } edgeMap[edge.id] = edge; } for (const auto &partKv : snapshot.parts) { diff --git a/src/skeletondocumentwindow.cpp b/src/skeletondocumentwindow.cpp index 93161842..f55959e8 100644 --- a/src/skeletondocumentwindow.cpp +++ b/src/skeletondocumentwindow.cpp @@ -219,6 +219,7 @@ SkeletonDocumentWindow::SkeletonDocumentWindow() : }); connect(this, &SkeletonDocumentWindow::initialized, m_document, [=]() { + m_document->saveSnapshot(); graphicsWidget->setFocus(); });