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

Method createIntKnob

Engine/Knob.cpp:5349–5371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5347}
5348
5349KnobIntPtr
5350KnobHolder::createIntKnob(const std::string& name,
5351 const std::string& label,
5352 int dimension,
5353 bool userKnob)
5354{
5355 KnobIPtr existingKnob = getKnobByName(name);
5356
5357 if (existingKnob) {
5358 return std::dynamic_pointer_cast<KnobInt>(existingKnob);
5359 }
5360 KnobIntPtr ret = AppManager::createKnob<KnobInt>(this, label, dimension, false);
5361 ret->setName(name);
5362 ret->setAsUserKnob(userKnob);
5363 /*KnobPagePtr pageknob = getOrCreateUserPageKnob();
5364 Q_UNUSED(pageknob);*/
5365 EffectInstance* isEffect = dynamic_cast<EffectInstance*>(this);
5366 if (isEffect && userKnob) {
5367 isEffect->getNode()->declarePythonFields();
5368 }
5369
5370 return ret;
5371}
5372
5373KnobDoublePtr
5374KnobHolder::createDoubleKnob(const std::string& name,

Callers 4

createIntParamMethod · 0.80
createInt2DParamMethod · 0.80
createInt3DParamMethod · 0.80

Calls 4

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

Tested by

no test coverage detected