imgui-node-editor
imgui-node-editor copied to clipboard
Link is not deleted when connected node is deleted
Hi
I'm using the last develop branch and I can see that if i'm deleting a connected node , the link is not deleted and still exist in memory. It cannot be dwran anymore but you can see that the ports are still connected:
I find a way to delete link when deleting from context menus
if (ImGui::MenuItem("Delete"))
{
ed::BreakLinks(contextNodeId); // force delete of links connected to the node
ed::DeleteNode(contextNodeId);
}
But I'm still unable to get it deleted if I delete the node using the delete key. The system seems to be different and deeply embedded in node editor internals 🤔
Hey, your problem is easy solvable. You just need to manually remove the links from the list. I made a Pull Request where this is shown #133
Thx, I managed to implement something like xthat at the application level. But I think it should be embedded at the lower level. Maybe by providing a bool when you want to delete a node with the connected links 🤔
In blueprint example there is a bug. There is a easy workaround. Basically first run node QueryDeletedNode
, this will queue all connected link to be deleted and QueryDeletedLink
will return them too.
Does this help?
Thanks ! I found a temporary solution , but I will try asap your fix
My choice of API make it easy to make this mistake. Sorry for that.
No problem, I'm already so happy to use such a nice tool ! :)
Duplicate of #182, fixed on develop
.