diff --git a/source/MaterialXGraphEditor/Graph.cpp b/source/MaterialXGraphEditor/Graph.cpp index 9710640130..134205bcff 100644 --- a/source/MaterialXGraphEditor/Graph.cpp +++ b/source/MaterialXGraphEditor/Graph.cpp @@ -2487,6 +2487,10 @@ void Graph::AddLink(ed::PinId inputPinId, ed::PinId outputPinId) { pin->_input->setConnectedOutput(_graphNodes[upNode]->getOutput()); } + else if (_graphNodes[upNode]->getInput() != nullptr) + { + pin->_input->setInterfaceName(_graphNodes[upNode]->getName()); + } else { // node graph @@ -3405,6 +3409,7 @@ void Graph::showHelp() const void Graph::addNodePopup(bool cursor) { bool open_AddPopup = ImGui::IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows) && ImGui::IsKeyReleased(ImGuiKey_Tab); + static char input[32]{ "" }; if (open_AddPopup) { cursor = true; @@ -3414,7 +3419,6 @@ void Graph::addNodePopup(bool cursor) { ImGui::Text("Add Node"); ImGui::Separator(); - static char input[32]{ "" }; if (cursor) { ImGui::SetKeyboardFocusHere(); @@ -3433,6 +3437,9 @@ void Graph::addNodePopup(bool cursor) { std::string str(it->second[i][0]); std::string nodeName = it->second[i][0]; + //allow spaces to be used to search for node names + std::replace(subs.begin(), subs.end(), ' ', '_'); + if (str.find(subs) != std::string::npos) { if (ImGui::MenuItem(getNodeDefId(nodeName).c_str()) || (ImGui::IsItemFocused() && ImGui::IsKeyPressedMap(ImGuiKey_Enter)))