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

Method refreshEnabledKnobsLabel

Engine/Node.cpp:9390–9450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9388}
9389
9390void
9391Node::refreshEnabledKnobsLabel(const ImagePlaneDesc& comp)
9392{
9393 const std::vector<std::string>& channels = comp.getChannels();
9394 if (!_imp->enabledChan[0].lock()) {
9395 return;
9396 }
9397 switch ( channels.size() ) {
9398 case 1: {
9399 for (int i = 0; i < 3; ++i) {
9400 boost::shared_ptr<KnobBool> enabled = _imp->enabledChan[i].lock();
9401 enabled->setSecret(true);
9402 }
9403 boost::shared_ptr<KnobBool> alpha = _imp->enabledChan[3].lock();
9404 alpha->setSecret(false);
9405 alpha->setLabel(channels[0]);
9406 break;
9407 }
9408 case 2: {
9409 for (int i = 2; i < 4; ++i) {
9410 boost::shared_ptr<KnobBool> enabled = _imp->enabledChan[i].lock();
9411 enabled->setSecret(true);
9412 }
9413 for (int i = 0; i < 2; ++i) {
9414 boost::shared_ptr<KnobBool> enabled = _imp->enabledChan[i].lock();
9415 enabled->setSecret(false);
9416 enabled->setLabel(channels[i]);
9417 }
9418 break;
9419 }
9420 case 3: {
9421 for (int i = 3; i < 4; ++i) {
9422 boost::shared_ptr<KnobBool> enabled = _imp->enabledChan[i].lock();
9423 enabled->setSecret(true);
9424 }
9425 for (int i = 0; i < 3; ++i) {
9426 boost::shared_ptr<KnobBool> enabled = _imp->enabledChan[i].lock();
9427 enabled->setSecret(false);
9428 enabled->setLabel(channels[i]);
9429 }
9430 break;
9431 }
9432 case 4: {
9433 for (int i = 0; i < 4; ++i) {
9434 boost::shared_ptr<KnobBool> enabled = _imp->enabledChan[i].lock();
9435 enabled->setSecret(false);
9436 enabled->setLabel(channels[i]);
9437 }
9438 break;
9439 }
9440
9441 case 0:
9442 default: {
9443 for (int i = 0; i < 4; ++i) {
9444 boost::shared_ptr<KnobBool> enabled = _imp->enabledChan[i].lock();
9445 enabled->setSecret(true);
9446 }
9447 break;

Callers 2

onLayerChangedMethod · 0.80

Calls 5

getChannelsMethod · 0.45
lockMethod · 0.45
sizeMethod · 0.45
setSecretMethod · 0.45
setLabelMethod · 0.45

Tested by

no test coverage detected