Skip to content

Commit

Permalink
[implicit] Don't write inputs for nodes that are not supposed to have…
Browse files Browse the repository at this point in the history
… them
  • Loading branch information
3dJan committed Feb 14, 2024
1 parent d29b113 commit b7fb18c
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Source/Model/Writer/NMR_ModelWriterNode_Implicit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,23 @@ namespace NMR

}

auto inputs = node.getInputs();
if (!inputs->empty())
bool const isNodeWithoutInputs = node.getNodeType() == Lib3MF::eImplicitNodeType::Constant ||
node.getNodeType() == Lib3MF::eImplicitNodeType::ConstVec ||
node.getNodeType() == Lib3MF::eImplicitNodeType::ConstMat ||
node.getNodeType() == Lib3MF::eImplicitNodeType::Resource;

if (!isNodeWithoutInputs) // Certain node types are not allowed to have inputs, but may have been set by the producer
{
writeStartElementWithPrefix(XML_3MF_ELEMENT_IMPLICIT_NODE_INPUT,
XML_3MF_NAMESPACEPREFIX_IMPLICIT);
auto inputs = node.getInputs();
if (!inputs->empty())
{
writeImplicitInputs(*inputs);
writeStartElementWithPrefix(XML_3MF_ELEMENT_IMPLICIT_NODE_INPUT,
XML_3MF_NAMESPACEPREFIX_IMPLICIT);
{
writeImplicitInputs(*inputs);
}
writeFullEndElement();
}
writeFullEndElement();
}

writeStartElementWithPrefix(XML_3MF_ELEMENT_IMPLICIT_NODE_OUTPUT,
Expand Down

0 comments on commit b7fb18c

Please sign in to comment.