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

Method disconnectInput

Engine/NodeInputs.cpp:1091–1163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1089}
1090
1091int
1092Node::disconnectInput(int inputNumber)
1093{
1094 assert(_imp->inputsInitialized);
1095
1096 NodePtr inputShared;
1097 bool useGuiValues = isNodeRendering();
1098 bool destroyed;
1099 {
1100 QMutexLocker k(&_imp->isBeingDestroyedMutex);
1101 destroyed = _imp->isBeingDestroyed;
1102 }
1103 if (!destroyed) {
1104 _imp->effect->abortAnyEvaluation();
1105 }
1106
1107 {
1108 QMutexLocker l(&_imp->inputsMutex);
1109 if ( (inputNumber < 0) ||
1110 ( inputNumber > (int)_imp->inputs.size() ) ||
1111 ( !useGuiValues && !_imp->inputs[inputNumber].lock() ) ||
1112 ( useGuiValues && !_imp->guiInputs[inputNumber].lock() ) ) {
1113 return -1;
1114 }
1115 inputShared = useGuiValues ? _imp->guiInputs[inputNumber].lock() : _imp->inputs[inputNumber].lock();
1116 }
1117
1118
1119 QObject::disconnect( inputShared.get(), SIGNAL(labelChanged(QString)), this, SLOT(onInputLabelChanged(QString)) );
1120 inputShared->disconnectOutput(useGuiValues, this);
1121
1122 {
1123 QMutexLocker l(&_imp->inputsMutex);
1124 if (!useGuiValues) {
1125 _imp->inputs[inputNumber].reset();
1126 _imp->guiInputs[inputNumber].reset();
1127 } else {
1128 _imp->guiInputs[inputNumber].reset();
1129 }
1130 }
1131
1132 {
1133 QMutexLocker k(&_imp->isBeingDestroyedMutex);
1134 if (_imp->isBeingDestroyed) {
1135 return -1;
1136 }
1137 }
1138
1139 Q_EMIT inputChanged(inputNumber);
1140 bool mustCallEnd = false;
1141 if (!useGuiValues) {
1142 beginInputEdition();
1143 mustCallEnd = true;
1144 onInputChanged(inputNumber);
1145 }
1146 bool creatingNodeTree = getApp()->isCreatingNodeTree();
1147 if (!creatingNodeTree) {
1148 ///Recompute the hash

Callers

nothing calls this directly

Calls 11

getAppFunction · 0.85
disconnectOutputMethod · 0.80
isCreatingNodeTreeMethod · 0.80
emptyMethod · 0.80
abortAnyEvaluationMethod · 0.45
sizeMethod · 0.45
lockMethod · 0.45
getMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected