MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / disconnectNodes

Method disconnectNodes

Engine/NodeGroup.cpp:619–646  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

617}
618
619bool
620NodeCollection::disconnectNodes(const NodePtr& input,
621 const NodePtr& output,
622 bool autoReconnect)
623{
624 NodePtr inputToReconnectTo;
625 int indexOfInput = output->inputIndex( input );
626
627 if (indexOfInput == -1) {
628 return false;
629 }
630
631 int inputsCount = input->getNInputs();
632 if (inputsCount == 1) {
633 inputToReconnectTo = input->getInput(0);
634 }
635
636
637 if (output->disconnectInput( input.get() ) < 0) {
638 return false;
639 }
640
641 if (autoReconnect && inputToReconnectTo) {
642 connectNodes(indexOfInput, inputToReconnectTo, output);
643 }
644
645 return true;
646}
647
648bool
649NodeCollection::autoConnectNodes(const NodePtr& selected,

Callers 2

removeItemMethod · 0.45
activateMethod · 0.45

Calls 5

inputIndexMethod · 0.80
getNInputsMethod · 0.45
getInputMethod · 0.45
disconnectInputMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected