Commit e214a9d8 authored by Martin Weismann's avatar Martin Weismann Committed by Martin Weismann
Browse files

Write a random UUID for non-root models

This is intended to be a temporary fix.
The spec schema differs from the spec's wording here.
https://github.com/3MFConsortium/spec_production/blob/master/3MF%20Production%20Extension.md#41-build
parent 6a95190a
Showing with 9 additions and 2 deletions
+9 -2
......@@ -794,10 +794,17 @@ namespace NMR {
{
writeStartElement(XML_3MF_ELEMENT_BUILD);
if (m_bWriteProductionExtension) {
if (!m_pModel->buildUUID().get()) {
PUUID pUUID;
if (m_bIsRootModel) {
pUUID = m_pModel->buildUUID();
}
else {
pUUID = std::make_shared<CUUID>();
}
if (!pUUID) {
throw CNMRException(NMR_ERROR_MISSINGUUID);
}
writePrefixedStringAttribute(XML_3MF_NAMESPACEPREFIX_PRODUCTION, XML_3MF_PRODUCTION_UUID, m_pModel->buildUUID()->toString());
writePrefixedStringAttribute(XML_3MF_NAMESPACEPREFIX_PRODUCTION, XML_3MF_PRODUCTION_UUID, pUUID->toString());
}
if (m_bIsRootModel)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment