Closed niclash closed 10 months ago
Yes. The intended mechanism to create new links is creation query.
if (ed::BeginCreate())
{
ed::PinId startPinId = 0, endPinId = 0;
if (ed::QueryNewLink(&startPinId, &endPinId))
{
if (<test-if-connection-between-startPinId-and-endPinId-is-valid)
{
ed::AcceptNewItem(); // tell editor that new link will be created
// create new link
}
else
{
ed::RejectNewItem();
}
}
ed::EndCreate();
}
Whole process is better described in basic-interaction-example: https://github.com/thedmd/imgui-node-editor/blob/6e1cadefc9840a5246cbf413fa38a9159cdc0942/examples/basic-interaction-example/basic-interaction-example.cpp#L121-L157
I have browsed the source code to try and figure out if there is a way to have my own "hook" in the create process.
This is what I want to do;
The same goes for Nodes, as well as for deletions and any other changes (position, name,...).
I can't locate any code that seems to allow for this.
Is this possible in current state of the
imgui-node-editor
?