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

Method createButtonKnob

Engine/Knob.cpp:5467–5488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5465}
5466
5467KnobButtonPtr
5468KnobHolder::createButtonKnob(const std::string& name,
5469 const std::string& label,
5470 bool userKnob)
5471{
5472 KnobIPtr existingKnob = getKnobByName(name);
5473
5474 if (existingKnob) {
5475 return std::dynamic_pointer_cast<KnobButton>(existingKnob);
5476 }
5477 KnobButtonPtr ret = AppManager::createKnob<KnobButton>(this, label, 1, false);
5478 ret->setName(name);
5479 ret->setAsUserKnob(userKnob);
5480 /*KnobPagePtr pageknob = getOrCreateUserPageKnob();
5481 Q_UNUSED(pageknob);*/
5482 EffectInstance* isEffect = dynamic_cast<EffectInstance*>(this);
5483 if (isEffect && userKnob) {
5484 isEffect->getNode()->declarePythonFields();
5485 }
5486
5487 return ret;
5488}
5489
5490KnobSeparatorPtr
5491KnobHolder::createSeparatorKnob(const std::string& name,

Callers 2

createButtonParamMethod · 0.80

Calls 4

setAsUserKnobMethod · 0.80
setNameMethod · 0.45
declarePythonFieldsMethod · 0.45
getNodeMethod · 0.45

Tested by

no test coverage detected