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

Method refreshActiveInputs

Engine/Node.cpp:11688–11726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11686}
11687
11688void
11689InspectorNode::refreshActiveInputs(int inputNbChanged,
11690 bool isASide)
11691{
11692 assert( QThread::currentThread() == qApp->thread() );
11693 NodePtr inputNode = getRealInput(inputNbChanged);
11694 {
11695 QMutexLocker l(&_activeInputsMutex);
11696 if (!inputNode) {
11697 ///check if the input was one of the active ones if so set to -1
11698 if (_activeInputs[0] == inputNbChanged) {
11699 _activeInputs[0] = -1;
11700 } else if (_activeInputs[1] == inputNbChanged) {
11701 _activeInputs[1] = -1;
11702 }
11703 } else {
11704 if ( !isASide && (_activeInputs[0] != -1) ) {
11705 ViewerInstance* isViewer = isEffectViewer();
11706 if (isViewer) {
11707 OpenGLViewerI* viewerUI = isViewer->getUiContext();
11708 if (viewerUI) {
11709 ViewerCompositingOperatorEnum op = viewerUI->getCompositingOperator();
11710 if (op == eViewerCompositingOperatorNone) {
11711 viewerUI->setCompositingOperator(eViewerCompositingOperatorWipeUnder);
11712 }
11713 }
11714 }
11715 _activeInputs[1] = inputNbChanged;
11716 } else {
11717 _activeInputs[0] = inputNbChanged;
11718 if (_activeInputs[1] == -1) {
11719 _activeInputs[1] = inputNbChanged;
11720 }
11721 }
11722 }
11723 }
11724 Q_EMIT activeInputsChanged();
11725 Q_EMIT refreshOptionalState();
11726}
11727
11728int
11729InspectorNode::getPreferredInputInternal(bool connected) const

Callers 1

onInputChangedMethod · 0.80

Calls 3

getUiContextMethod · 0.80

Tested by

no test coverage detected