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

Method handleFormatKnob

Engine/Node.cpp:2524–2562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2522}
2523
2524bool
2525Node::handleFormatKnob(KnobI* knob)
2526{
2527 KnobChoicePtr choice = _imp->pluginFormatKnobs.formatChoice.lock();
2528
2529 if (!choice) {
2530 return false;
2531 }
2532
2533 if ( knob != choice.get() ) {
2534 return false;
2535 }
2536 if (choice->getIsSecret()) {
2537 return true;
2538 }
2539 int curIndex = choice->getValue();
2540 Format f;
2541 if ( !getApp()->getProject()->getProjectFormatAtIndex(curIndex, &f) ) {
2542 assert(false);
2543
2544 return true;
2545 }
2546
2547 KnobIntPtr size = _imp->pluginFormatKnobs.size.lock();
2548 KnobDoublePtr par = _imp->pluginFormatKnobs.par.lock();
2549 assert(size && par);
2550
2551 _imp->effect->beginChanges();
2552 size->blockValueChanges();
2553 size->setValues(f.width(), f.height(), ViewSpec::all(), eValueChangedReasonNatronInternalEdited);
2554 size->unblockValueChanges();
2555 par->blockValueChanges();
2556 par->setValue( f.getPixelAspectRatio() );
2557 par->unblockValueChanges();
2558
2559 _imp->effect->endChanges();
2560
2561 return true;
2562}
2563
2564void
2565Node::refreshFormatParamChoice(const std::vector<ChoiceOption>& entries,

Callers 1

Calls 15

getAppFunction · 0.85
allFunction · 0.85
getIsSecretMethod · 0.80
getProjectMethod · 0.80
blockValueChangesMethod · 0.80
setValuesMethod · 0.80
unblockValueChangesMethod · 0.80
lockMethod · 0.45
getMethod · 0.45
getValueMethod · 0.45
beginChangesMethod · 0.45

Tested by

no test coverage detected