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

Method handleFormatKnob

Engine/Node.cpp:4275–4313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4273}
4274
4275bool
4276Node::handleFormatKnob(KnobI* knob)
4277{
4278 boost::shared_ptr<KnobChoice> choice = _imp->pluginFormatKnobs.formatChoice.lock();
4279
4280 if (!choice) {
4281 return false;
4282 }
4283
4284 if ( knob != choice.get() ) {
4285 return false;
4286 }
4287 if (choice->getIsSecret()) {
4288 return true;
4289 }
4290 int curIndex = choice->getValue();
4291 Format f;
4292 if ( !getApp()->getProject()->getProjectFormatAtIndex(curIndex, &f) ) {
4293 assert(false);
4294
4295 return true;
4296 }
4297
4298 boost::shared_ptr<KnobInt> size = _imp->pluginFormatKnobs.size.lock();
4299 boost::shared_ptr<KnobDouble> par = _imp->pluginFormatKnobs.par.lock();
4300 assert(size && par);
4301
4302 _imp->effect->beginChanges();
4303 size->blockValueChanges();
4304 size->setValues(f.width(), f.height(), ViewSpec::all(), eValueChangedReasonNatronInternalEdited);
4305 size->unblockValueChanges();
4306 par->blockValueChanges();
4307 par->setValue( f.getPixelAspectRatio() );
4308 par->unblockValueChanges();
4309
4310 _imp->effect->endChanges();
4311
4312 return true;
4313}
4314
4315void
4316Node::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