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

Method createStringKnob

Engine/Knob.cpp:5514–5535  ·  view source on GitHub ↗

Type corresponds to the Type enum defined in StringParamBase in Parameter.h

Source from the content-addressed store, hash-verified

5512
5513//Type corresponds to the Type enum defined in StringParamBase in Parameter.h
5514KnobStringPtr
5515KnobHolder::createStringKnob(const std::string& name,
5516 const std::string& label,
5517 bool userKnob)
5518{
5519 KnobIPtr existingKnob = getKnobByName(name);
5520
5521 if (existingKnob) {
5522 return std::dynamic_pointer_cast<KnobString>(existingKnob);
5523 }
5524 KnobStringPtr ret = AppManager::createKnob<KnobString>(this, label, 1, false);
5525 ret->setName(name);
5526 ret->setAsUserKnob(userKnob);
5527 /*KnobPagePtr pageknob = getOrCreateUserPageKnob();
5528 Q_UNUSED(pageknob);*/
5529 EffectInstance* isEffect = dynamic_cast<EffectInstance*>(this);
5530 if (isEffect && userKnob) {
5531 isEffect->getNode()->declarePythonFields();
5532 }
5533
5534 return ret;
5535}
5536
5537KnobFilePtr
5538KnobHolder::createFileKnob(const std::string& name,

Callers 2

createStringParamMethod · 0.80

Calls 4

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

Tested by

no test coverage detected