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

Method notifyNodeDeactivated

Engine/NodeGroup.cpp:1333–1388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1331}
1332
1333void
1334NodeGroup::notifyNodeDeactivated(const NodePtr& node)
1335{
1336 if ( getIsDeactivatingGroup() ) {
1337 return;
1338 }
1339 NodePtr thisNode = getNode();
1340
1341 {
1342 QMutexLocker k(&_imp->nodesLock);
1343 GroupInput* isInput = dynamic_cast<GroupInput*>( node->getEffectInstance().get() );
1344 if (isInput) {
1345 for (U32 i = 0; i < _imp->inputs.size(); ++i) {
1346 NodePtr input = _imp->inputs[i].lock();
1347 if (node == input) {
1348 ///Also disconnect the real input
1349
1350 thisNode->disconnectInput(i);
1351
1352
1353 _imp->inputs.erase(_imp->inputs.begin() + i);
1354 thisNode->initializeInputs();
1355
1356 return;
1357 }
1358 }
1359 ///The input must have been tracked before
1360 assert(false);
1361 }
1362 GroupOutput* isOutput = dynamic_cast<GroupOutput*>( node->getEffectInstance().get() );
1363 if (isOutput) {
1364 for (NodesWList::iterator it = _imp->outputs.begin(); it != _imp->outputs.end(); ++it) {
1365 if (it->lock()->getEffectInstance().get() == isOutput) {
1366 _imp->outputs.erase(it);
1367 break;
1368 }
1369 }
1370 }
1371
1372 ///Sync gui inputs/outputs
1373 _imp->guiInputs = _imp->inputs;
1374 _imp->guiOutputs = _imp->outputs;
1375 }
1376
1377 ///Notify outputs of the group nodes that their inputs may have changed
1378 const NodesWList& outputs = thisNode->getOutputs();
1379 for (NodesWList::const_iterator it = outputs.begin(); it != outputs.end(); ++it) {
1380 NodePtr output = it->lock();
1381 if (!output) {
1382 continue;
1383 }
1384 int idx = output->getInputIndex( thisNode.get() );
1385 assert(idx != -1);
1386 output->onInputChanged(idx);
1387 }
1388} // NodeGroup::notifyNodeDeactivated
1389
1390void

Callers 1

deactivateMethod · 0.45

Calls 12

getEffectInstanceMethod · 0.80
getInputIndexMethod · 0.80
getNodeFunction · 0.70
getMethod · 0.45
sizeMethod · 0.45
lockMethod · 0.45
disconnectInputMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
initializeInputsMethod · 0.45
endMethod · 0.45
onInputChangedMethod · 0.45

Tested by

no test coverage detected