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

Method refreshChannelSelectors

Engine/Node.cpp:7178–7253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7176}
7177
7178bool
7179Node::refreshChannelSelectors()
7180{
7181 if ( !isNodeCreated() ) {
7182 return false;
7183 }
7184
7185 double time = getApp()->getTimeLine()->currentFrame();
7186 // Refresh each layer selector (input and output)
7187 bool hasChanged = false;
7188 for (std::map<int, ChannelSelector>::iterator it = _imp->channelsSelectors.begin(); it != _imp->channelsSelectors.end(); ++it) {
7189
7190 int inputNb = it->first;
7191
7192
7193 // The Output Layer menu has a All choice, input layers menus have a None choice.
7194 std::vector<ChoiceOption> choices;
7195 if (inputNb >= 0) {
7196 choices.push_back(ChoiceOption("None", "", ""));
7197 }
7198
7199
7200 std::list<ImagePlaneDesc> availableComponents;
7201 _imp->effect->getAvailableLayers(time, ViewIdx(0), inputNb, &availableComponents);
7202
7203 for (std::list<ImagePlaneDesc>::const_iterator it2 = availableComponents.begin(); it2 != availableComponents.end(); ++it2) {
7204 ChoiceOption layerOption = it2->getPlaneOption();
7205 choices.push_back(layerOption);
7206 }
7207
7208 {
7209 KnobChoicePtr layerKnob = it->second.layer.lock();
7210
7211 bool menuChanged = layerKnob->populateChoices(choices);
7212 if (menuChanged) {
7213 hasChanged = true;
7214 if (inputNb == -1) {
7215 s_outputLayerChanged();
7216 }
7217 }
7218 }
7219 } // for each layer selector
7220
7221 // Refresh each mask channel selector
7222
7223 for (std::map<int, MaskSelector>::iterator it = _imp->maskSelectors.begin(); it != _imp->maskSelectors.end(); ++it) {
7224
7225 int inputNb = it->first;
7226 std::vector<ChoiceOption> choices;
7227 choices.push_back(ChoiceOption("None", "",""));
7228
7229 // Get the mask input components
7230 std::list<ImagePlaneDesc> availableComponents;
7231
7232 _imp->effect->getAvailableLayers(time, ViewIdx(0), inputNb, &availableComponents);
7233
7234
7235 for (std::list<ImagePlaneDesc>::const_iterator it2 = availableComponents.begin(); it2 != availableComponents.end(); ++it2) {

Callers 1

Calls 15

getAppFunction · 0.85
ChoiceOptionFunction · 0.85
s_outputLayerChangedFunction · 0.85
getPlaneOptionMethod · 0.80
populateChoicesMethod · 0.80
getChannelOptionMethod · 0.80
ViewIdxClass · 0.70
currentFrameMethod · 0.45
getTimeLineMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected