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

Method onProjectViewsChanged

Engine/JoinViewsNode.cpp:129–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129void
130JoinViewsNode::onProjectViewsChanged()
131{
132 std::size_t nInputs, oldNInputs;
133 {
134 QMutexLocker k(&_imp->inputsMutex);
135 const std::vector<std::string>& views = getApp()->getProject()->getProjectViewNames();
136
137 //Reverse names
138 oldNInputs = _imp->inputs.size();
139 nInputs = views.size();
140 _imp->inputs.resize(nInputs);
141 for (std::size_t i = 0; i < nInputs; ++i) {
142 _imp->inputs[i] = views[nInputs - 1 - i];
143 }
144 }
145 std::vector<NodePtr> inputs(oldNInputs);
146 NodePtr node = getNode();
147
148 for (std::size_t i = 0; i < oldNInputs; ++i) {
149 inputs[i] = node->getInput(i);
150 }
151 node->initializeInputs();
152
153 //Reconnect the inputs
154 int index = oldNInputs - 1;
155 if (index >= 0) {
156 node->beginInputEdition();
157
158 for (int i = (int)nInputs - 1; i >= 0; --i, --index) {
159 node->disconnectInput(i);
160 if (index >= 0) {
161 if (inputs[index]) {
162 node->connectInput(inputs[index], i);
163 }
164 }
165 }
166
167 node->endInputEdition(true);
168 }
169}
170
171NATRON_NAMESPACE_EXIT
172

Callers

nothing calls this directly

Calls 11

getAppFunction · 0.85
getProjectMethod · 0.80
beginInputEditionMethod · 0.80
endInputEditionMethod · 0.80
getNodeFunction · 0.70
sizeMethod · 0.45
resizeMethod · 0.45
getInputMethod · 0.45
initializeInputsMethod · 0.45
disconnectInputMethod · 0.45
connectInputMethod · 0.45

Tested by

no test coverage detected