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

Method onInputChanged

Engine/NodeInputs.cpp:1597–1713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1595}
1596
1597void
1598Node::onInputChanged(int inputNb,
1599 bool isInputA)
1600{
1601 if ( getApp()->getProject()->isProjectClosing() ) {
1602 return;
1603 }
1604 assert( QThread::currentThread() == qApp->thread() );
1605
1606 bool mustCallEndInputEdition = _imp->inputModifiedRecursion == 0;
1607 if (mustCallEndInputEdition) {
1608 beginInputEdition();
1609 }
1610
1611 refreshMaskEnabledNess(inputNb);
1612 refreshLayersChoiceSecretness(inputNb);
1613
1614 InspectorNode* isInspector = dynamic_cast<InspectorNode*>(this);
1615 if (isInspector) {
1616 isInspector->refreshActiveInputs(inputNb, isInputA);
1617 }
1618
1619 bool shouldDoInputChanged = ( !getApp()->getProject()->isProjectClosing() && !getApp()->isCreatingNodeTree() ) ||
1620 _imp->effect->isRotoPaintNode();
1621
1622 if (shouldDoInputChanged) {
1623 ///When loading a group (or project) just wait until everything is setup to actually compute input
1624 ///related data such as clip preferences
1625 ///Exception for the Rotopaint node which needs to setup its own graph internally
1626
1627 /**
1628 * The plug-in might call getImage, set a valid thread storage on the tree.
1629 **/
1630 double time = getApp()->getTimeLine()->currentFrame();
1631 AbortableRenderInfoPtr abortInfo = AbortableRenderInfo::create(false, 0);
1632 const bool isRenderUserInteraction = true;
1633 const bool isSequentialRender = false;
1634 AbortableThread* isAbortable = dynamic_cast<AbortableThread*>( QThread::currentThread() );
1635 if (isAbortable) {
1636 isAbortable->setAbortInfo( isRenderUserInteraction, abortInfo, getEffectInstance() );
1637 }
1638 ParallelRenderArgsSetter frameRenderArgs( time,
1639 ViewIdx(0),
1640 isRenderUserInteraction,
1641 isSequentialRender,
1642 abortInfo,
1643 shared_from_this(),
1644 0, //texture index
1645 getApp()->getTimeLine().get(),
1646 NodePtr(),
1647 false,
1648 false,
1649 RenderStatsPtr() );
1650
1651
1652 ///Don't do clip preferences while loading a project, they will be refreshed globally once the project is loaded.
1653 _imp->effect->onInputChanged(inputNb);
1654 _imp->inputsModified.insert(inputNb);

Callers

nothing calls this directly

Calls 15

getAppFunction · 0.85
isProjectClosingMethod · 0.80
getProjectMethod · 0.80
refreshActiveInputsMethod · 0.80
isCreatingNodeTreeMethod · 0.80
setAbortInfoMethod · 0.80
clearRenderInstancesMethod · 0.80
isDequeueingValuesSetMethod · 0.80
getInputsMethod · 0.80
ViewIdxClass · 0.70

Tested by

no test coverage detected