本文整理汇总了C++中KnobBoolPtr::setAnimationEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ KnobBoolPtr::setAnimationEnabled方法的具体用法?C++ KnobBoolPtr::setAnimationEnabled怎么用?C++ KnobBoolPtr::setAnimationEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KnobBoolPtr
的用法示例。
在下文中一共展示了KnobBoolPtr::setAnimationEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getModel
void
TrackMarker::initializeKnobs()
{
KnobItemsTablePtr model = getModel();
EffectInstancePtr effect;
if (model) {
effect = model->getNode()->getEffectInstance();
}
KnobIntPtr defPatternSizeKnob, defSearchSizeKnob;
KnobChoicePtr defMotionModelKnob;
defPatternSizeKnob = toKnobInt(effect->getKnobByName(kTrackerUIParamDefaultMarkerPatternWinSize));
defSearchSizeKnob = toKnobInt(effect->getKnobByName(kTrackerUIParamDefaultMarkerSearchWinSize));
defMotionModelKnob = toKnobChoice(effect->getKnobByName(kTrackerUIParamDefaultMotionModel));
double patternHalfSize = defPatternSizeKnob ? defPatternSizeKnob->getValue() / 2. : 21;
double searchHalfSize = defSearchSizeKnob ? defSearchSizeKnob->getValue() / 2. : 71;
int defMotionModel_i = defMotionModelKnob ? defMotionModelKnob->getValue() : 0;
KnobDoublePtr swbbtmLeft = createKnob<KnobDouble>(kTrackerParamSearchWndBtmLeft, 2);
swbbtmLeft->setLabel(tr(kTrackerParamSearchWndBtmLeftLabel));
swbbtmLeft->setDefaultValue(-searchHalfSize, DimIdx(0));
swbbtmLeft->setDefaultValue(-searchHalfSize, DimIdx(1));
swbbtmLeft->setHintToolTip( tr(kTrackerParamSearchWndBtmLeftHint) );
_imp->searchWindowBtmLeft = swbbtmLeft;
KnobDoublePtr swbtRight = createKnob<KnobDouble>(kTrackerParamSearchWndTopRight, 2);
swbtRight->setLabel(tr(kTrackerParamSearchWndTopRightLabel));
swbtRight->setDefaultValue(searchHalfSize, DimIdx(0));
swbtRight->setDefaultValue(searchHalfSize, DimIdx(1));
swbtRight->setHintToolTip( tr(kTrackerParamSearchWndTopRightHint) );
_imp->searchWindowTopRight = swbtRight;
KnobDoublePtr ptLeft = createKnob<KnobDouble>(kTrackerParamPatternTopLeft, 2);
ptLeft->setLabel(tr(kTrackerParamPatternTopLeftLabel));
ptLeft->setDefaultValue(-patternHalfSize, DimIdx(0));
ptLeft->setDefaultValue(patternHalfSize, DimIdx(1));
ptLeft->setHintToolTip( tr(kTrackerParamPatternTopLeftHint) );
_imp->patternTopLeft = ptLeft;
KnobDoublePtr ptRight = createKnob<KnobDouble>(kTrackerParamPatternTopRight, 2);
ptRight->setLabel(tr(kTrackerParamPatternTopRightLabel));
ptRight->setDefaultValue(patternHalfSize, DimIdx(0));
ptRight->setDefaultValue(patternHalfSize, DimIdx(1));
ptRight->setHintToolTip( tr(kTrackerParamPatternTopRightHint) );
_imp->patternTopRight = ptRight;
KnobDoublePtr pBRight = createKnob<KnobDouble>(kTrackerParamPatternBtmRight, 2);
pBRight->setLabel(tr(kTrackerParamPatternBtmRightLabel));
pBRight->setDefaultValue(patternHalfSize, DimIdx(0));
pBRight->setDefaultValue(-patternHalfSize, DimIdx(1));
pBRight->setHintToolTip( tr(kTrackerParamPatternBtmRightHint) );
_imp->patternBtmRight = pBRight;
KnobDoublePtr pBLeft = createKnob<KnobDouble>(kTrackerParamPatternBtmLeft, 2);
pBLeft->setLabel(tr(kTrackerParamPatternBtmLeftLabel));
pBLeft->setDefaultValue(-patternHalfSize, DimIdx(0));
pBLeft->setDefaultValue(-patternHalfSize, DimIdx(1));
pBLeft->setHintToolTip( tr(kTrackerParamPatternBtmLeftHint) );
_imp->patternBtmLeft = pBLeft;
KnobDoublePtr centerKnob = createKnob<KnobDouble>(kTrackerParamCenter, 2);
centerKnob->setLabel(tr(kTrackerParamCenterLabel));
centerKnob->setHintToolTip( tr(kTrackerParamCenterHint) );
_imp->center = centerKnob;
KnobDoublePtr offsetKnob = createKnob<KnobDouble>(kTrackerParamOffset, 2);
offsetKnob->setLabel(tr(kTrackerParamOffsetLabel));
offsetKnob->setHintToolTip( tr(kTrackerParamOffsetHint) );
_imp->offset = offsetKnob;
#ifdef NATRON_TRACK_MARKER_USE_WEIGHT
KnobDoublePtr weightKnob = createKnob<KnobDouble>(kTrackerParamTrackWeight, 1);
weightKnob->setLabel(tr(kTrackerParamTrackWeightLabel));
weightKnob->setHintToolTip( tr(kTrackerParamTrackWeightHint) );
weightKnob->setDefaultValue(1.);
weightKnob->setAnimationEnabled(false);
weightKnob->setRange(0., 1.);
_imp->weight = weightKnob;
#endif
KnobChoicePtr mmodelKnob = createKnob<KnobChoice>(kTrackerParamMotionModel, 1);
mmodelKnob->setHintToolTip( tr(kTrackerParamMotionModelHint) );
mmodelKnob->setLabel(tr(kTrackerParamMotionModelLabel));
{
std::vector<ChoiceOption> choices, helps;
std::map<int, std::string> icons;
TrackerNodePrivate::getMotionModelsAndHelps(true, &choices, &icons);
mmodelKnob->populateChoices(choices);
mmodelKnob->setIcons(icons);
}
mmodelKnob->setDefaultValue(defMotionModel_i);
_imp->motionModel = mmodelKnob;
KnobDoublePtr errKnob = createKnob<KnobDouble>(kTrackerParamError, 1);
errKnob->setLabel(tr(kTrackerParamErrorLabel));
_imp->error = errKnob;
//.........这里部分代码省略.........
示例2: tr
void
TrackMarker::initializeKnobs()
{
TrackerContextPtr context = _imp->context.lock();
KnobIntPtr defPatternSizeKnob = context->getDefaultMarkerPatternWinSizeKnob();
KnobIntPtr defSearchSizeKnob = context->getDefaultMarkerSearchWinSizeKnob();
double patternHalfSize = defPatternSizeKnob->getValue() / 2.;
double searchHalfSize = defSearchSizeKnob->getValue() / 2.;
KnobDoublePtr swbbtmLeft = AppManager::createKnob<KnobDouble>(shared_from_this(), tr(kTrackerParamSearchWndBtmLeftLabel), 2, false);
swbbtmLeft->setName(kTrackerParamSearchWndBtmLeft);
swbbtmLeft->setDefaultValue(-searchHalfSize, 0);
swbbtmLeft->setDefaultValue(-searchHalfSize, 1);
swbbtmLeft->setHintToolTip( tr(kTrackerParamSearchWndBtmLeftHint) );
_imp->searchWindowBtmLeft = swbbtmLeft;
KnobDoublePtr swbtRight = AppManager::createKnob<KnobDouble>(shared_from_this(), tr(kTrackerParamSearchWndTopRightLabel), 2, false);
swbtRight->setName(kTrackerParamSearchWndTopRight);
swbtRight->setDefaultValue(searchHalfSize, 0);
swbtRight->setDefaultValue(searchHalfSize, 1);
swbtRight->setHintToolTip( tr(kTrackerParamSearchWndTopRightHint) );
_imp->searchWindowTopRight = swbtRight;
KnobDoublePtr ptLeft = AppManager::createKnob<KnobDouble>(shared_from_this(), tr(kTrackerParamPatternTopLeftLabel), 2, false);
ptLeft->setName(kTrackerParamPatternTopLeft);
ptLeft->setDefaultValue(-patternHalfSize, 0);
ptLeft->setDefaultValue(patternHalfSize, 1);
ptLeft->setHintToolTip( tr(kTrackerParamPatternTopLeftHint) );
_imp->patternTopLeft = ptLeft;
KnobDoublePtr ptRight = AppManager::createKnob<KnobDouble>(shared_from_this(), tr(kTrackerParamPatternTopRightLabel), 2, false);
ptRight->setName(kTrackerParamPatternTopRight);
ptRight->setDefaultValue(patternHalfSize, 0);
ptRight->setDefaultValue(patternHalfSize, 1);
ptRight->setHintToolTip( tr(kTrackerParamPatternTopRightHint) );
_imp->patternTopRight = ptRight;
KnobDoublePtr pBRight = AppManager::createKnob<KnobDouble>(shared_from_this(), tr(kTrackerParamPatternBtmRightLabel), 2, false);
pBRight->setName(kTrackerParamPatternBtmRight);
pBRight->setDefaultValue(patternHalfSize, 0);
pBRight->setDefaultValue(-patternHalfSize, 1);
pBRight->setHintToolTip( tr(kTrackerParamPatternBtmRightHint) );
_imp->patternBtmRight = pBRight;
KnobDoublePtr pBLeft = AppManager::createKnob<KnobDouble>(shared_from_this(), tr(kTrackerParamPatternBtmLeftLabel), 2, false);
pBLeft->setName(kTrackerParamPatternBtmLeft);
pBLeft->setDefaultValue(-patternHalfSize, 0);
pBLeft->setDefaultValue(-patternHalfSize, 1);
pBLeft->setHintToolTip( tr(kTrackerParamPatternBtmLeftHint) );
_imp->patternBtmLeft = pBLeft;
KnobDoublePtr centerKnob = AppManager::createKnob<KnobDouble>(shared_from_this(), tr(kTrackerParamCenterLabel), 2, false);
centerKnob->setName(kTrackerParamCenter);
centerKnob->setHintToolTip( tr(kTrackerParamCenterHint) );
_imp->center = centerKnob;
KnobDoublePtr offsetKnob = AppManager::createKnob<KnobDouble>(shared_from_this(), tr(kTrackerParamOffsetLabel), 2, false);
offsetKnob->setName(kTrackerParamOffset);
offsetKnob->setHintToolTip( tr(kTrackerParamOffsetHint) );
_imp->offset = offsetKnob;
#ifdef NATRON_TRACK_MARKER_USE_WEIGHT
KnobDoublePtr weightKnob = AppManager::createKnob<KnobDouble>(shared_from_this(), tr(kTrackerParamTrackWeightLabel), 1, false);
weightKnob->setName(kTrackerParamTrackWeight);
weightKnob->setHintToolTip( tr(kTrackerParamTrackWeightHint) );
weightKnob->setDefaultValue(1.);
weightKnob->setAnimationEnabled(false);
weightKnob->setMinimum(0.);
weightKnob->setMaximum(1.);
_imp->weight = weightKnob;
#endif
KnobChoicePtr mmodelKnob = AppManager::createKnob<KnobChoice>(shared_from_this(), tr(kTrackerParamMotionModelLabel), 1, false);
mmodelKnob->setHintToolTip( tr(kTrackerParamMotionModelHint) );
mmodelKnob->setName(kTrackerParamMotionModel);
{
std::vector<std::string> choices, helps;
TrackerContext::getMotionModelsAndHelps(true, &choices, &helps);
mmodelKnob->populateChoices(choices, helps);
}
mmodelKnob->setDefaultValue(0);
_imp->motionModel = mmodelKnob;
KnobDoublePtr errKnob = AppManager::createKnob<KnobDouble>(shared_from_this(), tr(kTrackerParamErrorLabel), 1, false);
errKnob->setName(kTrackerParamError);
_imp->error = errKnob;
KnobBoolPtr enableKnob = AppManager::createKnob<KnobBool>(shared_from_this(), tr(kTrackerParamEnabledLabel), 1, false);
enableKnob->setName(kTrackerParamEnabled);
enableKnob->setHintToolTip( tr(kTrackerParamEnabledHint) );
enableKnob->setAnimationEnabled(true);
enableKnob->setDefaultValue(true);
_imp->enabled = enableKnob;
QObject::connect( this, SIGNAL(enabledChanged(int)), _imp->context.lock().get(), SLOT(onMarkerEnabledChanged(int)) );
boost::shared_ptr<KnobSignalSlotHandler> handler = _imp->center.lock()->getSignalSlotHandler();
//.........这里部分代码省略.........