| 5166 | } // Node::Implementation::getSelectedLayerInternal |
| 5167 | |
| 5168 | void |
| 5169 | Node::Implementation::onLayerChanged(int inputNb, |
| 5170 | const ChannelSelector& selector) |
| 5171 | { |
| 5172 | KnobChoicePtr layerKnob = selector.layer.lock(); |
| 5173 | bool outputIsAll = processAllLayersKnob.lock()->getValue(); |
| 5174 | |
| 5175 | if (inputNb == -1) { |
| 5176 | |
| 5177 | ///Disable all input selectors as it doesn't make sense to edit them whilst output is All |
| 5178 | for (std::map<int, ChannelSelector>::iterator it = channelsSelectors.begin(); it != channelsSelectors.end(); ++it) { |
| 5179 | |
| 5180 | NodePtr inp; |
| 5181 | if (it->first >= 0) { |
| 5182 | inp = _publicInterface->getInput(it->first); |
| 5183 | } |
| 5184 | bool mustBeSecret = (it->first >= 0 && !inp.get()) || outputIsAll; |
| 5185 | it->second.layer.lock()->setSecret(mustBeSecret); |
| 5186 | |
| 5187 | } |
| 5188 | } |
| 5189 | if (!isRefreshingInputRelatedData) { |
| 5190 | ///Clip preferences have changed |
| 5191 | RenderScale s(1.); |
| 5192 | effect->refreshMetadata_public(true); |
| 5193 | } |
| 5194 | if ( !enabledChan[0].lock() ) { |
| 5195 | return; |
| 5196 | } |
| 5197 | |
| 5198 | if (inputNb == -1) { |
| 5199 | if (outputIsAll) { |
| 5200 | for (int i = 0; i < 4; ++i) { |
| 5201 | enabledChan[i].lock()->setSecret(true); |
| 5202 | } |
| 5203 | } else { |
| 5204 | std::list<ImagePlaneDesc> availablePlanes; |
| 5205 | effect->getAvailableLayers(_publicInterface->getApp()->getTimeLine()->currentFrame(), ViewIdx(0), inputNb, &availablePlanes); |
| 5206 | |
| 5207 | ImagePlaneDesc comp = getSelectedLayerInternal(inputNb, availablePlanes, selector); |
| 5208 | _publicInterface->refreshEnabledKnobsLabel(comp); |
| 5209 | } |
| 5210 | |
| 5211 | _publicInterface->s_outputLayerChanged(); |
| 5212 | } |
| 5213 | } |
| 5214 | |
| 5215 | void |
| 5216 | Node::refreshEnabledKnobsLabel(const ImagePlaneDesc& comp) |
no test coverage detected