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

Method onInputChanged

Engine/Node.cpp:8113–8229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8111}
8112
8113void
8114Node::onInputChanged(int inputNb,
8115 bool isInputA)
8116{
8117 if ( getApp()->getProject()->isProjectClosing() ) {
8118 return;
8119 }
8120 assert( QThread::currentThread() == qApp->thread() );
8121
8122 bool mustCallEndInputEdition = _imp->inputModifiedRecursion == 0;
8123 if (mustCallEndInputEdition) {
8124 beginInputEdition();
8125 }
8126
8127 refreshMaskEnabledNess(inputNb);
8128 refreshLayersChoiceSecretness(inputNb);
8129
8130 InspectorNode* isInspector = dynamic_cast<InspectorNode*>(this);
8131 if (isInspector) {
8132 isInspector->refreshActiveInputs(inputNb, isInputA);
8133 }
8134
8135 bool shouldDoInputChanged = ( !getApp()->getProject()->isProjectClosing() && !getApp()->isCreatingNodeTree() ) ||
8136 _imp->effect->isRotoPaintNode();
8137
8138 if (shouldDoInputChanged) {
8139 ///When loading a group (or project) just wait until everything is setup to actually compute input
8140 ///related data such as clip preferences
8141 ///Exception for the Rotopaint node which needs to setup its own graph internally
8142
8143 /**
8144 * The plug-in might call getImage, set a valid thread storage on the tree.
8145 **/
8146 double time = getApp()->getTimeLine()->currentFrame();
8147 AbortableRenderInfoPtr abortInfo = AbortableRenderInfo::create(false, 0);
8148 const bool isRenderUserInteraction = true;
8149 const bool isSequentialRender = false;
8150 AbortableThread* isAbortable = dynamic_cast<AbortableThread*>( QThread::currentThread() );
8151 if (isAbortable) {
8152 isAbortable->setAbortInfo( isRenderUserInteraction, abortInfo, getEffectInstance() );
8153 }
8154 ParallelRenderArgsSetter frameRenderArgs( time,
8155 ViewIdx(0),
8156 isRenderUserInteraction,
8157 isSequentialRender,
8158 abortInfo,
8159 shared_from_this(),
8160 0, //texture index
8161 getApp()->getTimeLine().get(),
8162 NodePtr(),
8163 false,
8164 false,
8165 boost::shared_ptr<RenderStats>() );
8166
8167
8168 ///Don't do clip preferences while loading a project, they will be refreshed globally once the project is loaded.
8169 _imp->effect->onInputChanged(inputNb);
8170 _imp->inputsModified.insert(inputNb);

Callers 4

notifyNodeDeactivatedMethod · 0.45
notifyNodeActivatedMethod · 0.45
refreshOutputNodeMethod · 0.45

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