@@ -1191,7 +1191,10 @@ void Document::upgradeVersion()
11911191 {
11921192 // Replace swizzle with constant.
11931193 node->setCategory (" constant" );
1194- node->removeAttribute (InterfaceElement::NODE_DEF_ATTRIBUTE);
1194+ if (node->hasNodeDefString ())
1195+ {
1196+ node->setNodeDefString (" ND_constant_" + node->getType ());
1197+ }
11951198 string valueString = inInput->getValueString ();
11961199 StringVec origValueTokens = splitString (valueString, ARRAY_VALID_SEPARATORS);
11971200 StringVec newValueTokens;
@@ -1229,7 +1232,10 @@ void Document::upgradeVersion()
12291232 {
12301233 // Replace swizzle with extract.
12311234 node->setCategory (" extract" );
1232- node->removeAttribute (InterfaceElement::NODE_DEF_ATTRIBUTE);
1235+ if (node->hasNodeDefString ())
1236+ {
1237+ node->setNodeDefString (" ND_extract_" + node->getType ());
1238+ }
12331239 if (!channelString.empty () && CHANNEL_INDEX_MAP.count (channelString[0 ]))
12341240 {
12351241 node->setInputValue (" index" , (int ) CHANNEL_INDEX_MAP.at (channelString[0 ]));
@@ -1240,13 +1246,19 @@ void Document::upgradeVersion()
12401246 {
12411247 // Replace swizzle with convert.
12421248 node->setCategory (" convert" );
1243- node->removeAttribute (InterfaceElement::NODE_DEF_ATTRIBUTE);
1249+ if (node->hasNodeDefString ())
1250+ {
1251+ node->setNodeDefString (" ND_convert_" + sourceType + " _" + destType);
1252+ }
12441253 }
12451254 else if (sourceChannelCount == 1 )
12461255 {
12471256 // Replace swizzle with combine.
12481257 node->setCategory (" combine" + std::to_string (destChannelCount));
1249- node->removeAttribute (InterfaceElement::NODE_DEF_ATTRIBUTE);
1258+ if (node->hasNodeDefString ())
1259+ {
1260+ node->setNodeDefString (" ND_combine" + std::to_string (destChannelCount) + " _" + node->getType ());
1261+ }
12501262 for (size_t i = 0 ; i < destChannelCount; i++)
12511263 {
12521264 InputPtr combineInInput = node->addInput (std::string (" in" ) + std::to_string (i + 1 ), " float" );
@@ -1273,7 +1285,10 @@ void Document::upgradeVersion()
12731285 graph->setChildIndex (separateNode->getName (), childIndex);
12741286 }
12751287 node->setCategory (" combine" + std::to_string (destChannelCount));
1276- node->removeAttribute (InterfaceElement::NODE_DEF_ATTRIBUTE);
1288+ if (node->hasNodeDefString ())
1289+ {
1290+ node->setNodeDefString (" ND_combine" + std::to_string (destChannelCount) + " _" + node->getType ());
1291+ }
12771292 for (size_t i = 0 ; i < destChannelCount; i++)
12781293 {
12791294 InputPtr combineInInput = node->addInput (std::string (" in" ) + std::to_string (i + 1 ), " float" );
0 commit comments