diff --git a/Source/Falcor/RenderGraph/RenderGraphUI.cpp b/Source/Falcor/RenderGraph/RenderGraphUI.cpp index d0a0bcd4a..57a22e375 100644 --- a/Source/Falcor/RenderGraph/RenderGraphUI.cpp +++ b/Source/Falcor/RenderGraph/RenderGraphUI.cpp @@ -1066,7 +1066,8 @@ namespace Falcor RenderPass* pNodeRenderPass = mpRenderGraph->getPass(currentPass.first).get(); nameString = currentPass.first; - if (!mpNodeGraphEditor->getAllNodesOfType(currentPassUI.mGuiNodeID, nullptr, false)) + ImVector nodesOut; + if (!mpNodeGraphEditor->getAllNodesOfType(currentPassUI.mGuiNodeID, &nodesOut, false)) { float2 nextPosition = mAddedFromDragAndDrop ? mNewNodeStartPosition : getNextNodePosition(mpRenderGraph->getPassIndex(nameString)); @@ -1075,6 +1076,13 @@ namespace Falcor ImVec2(nextPosition.x, nextPosition.y)); mAddedFromDragAndDrop = false; } + else + { + for (auto& node : nodesOut) + { + node->updateSlotNames(inputsString.c_str(), outputsString.c_str()); + } + } } updatePins(); diff --git a/external/imgui_addons/imguinodegrapheditor/imguinodegrapheditor.cpp b/external/imgui_addons/imguinodegrapheditor/imguinodegrapheditor.cpp index e0eca72c8..6d96fea5c 100644 --- a/external/imgui_addons/imguinodegrapheditor/imguinodegrapheditor.cpp +++ b/external/imgui_addons/imguinodegrapheditor/imguinodegrapheditor.cpp @@ -1975,6 +1975,11 @@ namespace ImGui { isOpen = true; } + IMGUI_API void Node::updateSlotNames(const char* inputSlotNamesSeparatedBySemicolons, const char* outputSlotNamesSeparatedBySemicolons) { + InputsCount = ProcessSlotNamesSeparatedBySemicolons(inputSlotNamesSeparatedBySemicolons, InputNames); + OutputsCount = ProcessSlotNamesSeparatedBySemicolons(outputSlotNamesSeparatedBySemicolons, OutputNames); + } + /* bool FieldInfo::copyFrom(const FieldInfo &f) { if (!isCompatibleWith(f)) return false; diff --git a/external/imgui_addons/imguinodegrapheditor/imguinodegrapheditor.h b/external/imgui_addons/imguinodegrapheditor/imguinodegrapheditor.h index 9a53de87d..c58f71600 100644 --- a/external/imgui_addons/imguinodegrapheditor/imguinodegrapheditor.h +++ b/external/imgui_addons/imguinodegrapheditor/imguinodegrapheditor.h @@ -268,6 +268,7 @@ namespace ImGui { inline int getNumInputSlots() const { return InputsCount; } inline int getNumOutputSlots() const { return OutputsCount; } inline void setOpen(bool flag) { isOpen = flag; } + IMGUI_API void updateSlotNames(const char* inputSlotNamesSeparatedBySemicolons = NULL, const char* outputSlotNamesSeparatedBySemicolons = NULL); protected: FieldInfoVector fields; // I guess you can just skip these at all and implement virtual methods... but it was supposed to be useful...