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

Method initializeInputs

Engine/Node.cpp:5142–5205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5140}
5141
5142void
5143Node::initializeInputs()
5144{
5145 ////Only called by the main-thread
5146 assert( QThread::currentThread() == qApp->thread() );
5147 const int inputCount = getMaxInputCount();
5148 InputsV oldInputs;
5149 {
5150 QMutexLocker k(&_imp->inputsLabelsMutex);
5151 _imp->inputLabels.resize(inputCount);
5152 _imp->inputHints.resize(inputCount);
5153 for (int i = 0; i < inputCount; ++i) {
5154 _imp->inputLabels[i] = _imp->effect->getInputLabel(i);
5155 _imp->inputHints[i] = _imp->effect->getInputHint(i);
5156 }
5157 }
5158 {
5159 QMutexLocker l(&_imp->lastRenderStartedMutex);
5160 _imp->inputIsRenderingCounter.resize(inputCount);
5161 }
5162 {
5163 QMutexLocker l(&_imp->inputsMutex);
5164 oldInputs = _imp->inputs;
5165
5166 std::vector<bool> oldInputsVisibility = _imp->inputsVisibility;
5167 _imp->inputIsRenderingCounter.resize(inputCount);
5168 _imp->inputs.resize(inputCount);
5169 _imp->guiInputs.resize(inputCount);
5170 _imp->inputsVisibility.resize(inputCount);
5171 ///if we added inputs, just set to NULL the new inputs, and add their label to the labels map
5172 for (int i = 0; i < inputCount; ++i) {
5173 if ( i < (int)oldInputs.size() ) {
5174 _imp->inputs[i] = oldInputs[i];
5175 _imp->guiInputs[i] = oldInputs[i];
5176 } else {
5177 _imp->inputs[i].reset();
5178 _imp->guiInputs[i].reset();
5179 }
5180 if (i < (int) oldInputsVisibility.size()) {
5181 _imp->inputsVisibility[i] = oldInputsVisibility[i];
5182 } else {
5183 _imp->inputsVisibility[i] = true;
5184 }
5185 }
5186
5187
5188 ///Set the components the plug-in accepts
5189 _imp->inputsComponents.resize(inputCount);
5190 for (int i = 0; i < inputCount; ++i) {
5191 _imp->inputsComponents[i].clear();
5192 if ( _imp->effect->isInputMask(i) ) {
5193 //Force alpha for masks
5194 _imp->inputsComponents[i].push_back( ImagePlaneDesc::getAlphaComponents() );
5195 } else {
5196 _imp->effect->addAcceptedComponents(i, &_imp->inputsComponents[i]);
5197 }
5198 }
5199 _imp->outputComponents.clear();

Callers 11

createReadNodeMethod · 0.45
notifyNodeDeactivatedMethod · 0.45
notifyNodeActivatedMethod · 0.45
notifyNodeNameChangedMethod · 0.45
createWriteNodeMethod · 0.45
onProjectViewsChangedMethod · 0.45

Calls 9

resizeMethod · 0.45
getInputLabelMethod · 0.45
getInputHintMethod · 0.45
sizeMethod · 0.45
resetMethod · 0.45
clearMethod · 0.45
isInputMaskMethod · 0.45
push_backMethod · 0.45
addAcceptedComponentsMethod · 0.45

Tested by

no test coverage detected