本文整理汇总了C++中KeyFrame::setValue方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyFrame::setValue方法的具体用法?C++ KeyFrame::setValue怎么用?C++ KeyFrame::setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyFrame
的用法示例。
在下文中一共展示了KeyFrame::setValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sender
void
KnobGui::onSetKeyActionTriggered()
{
QAction* action = qobject_cast<QAction*>( sender() );
assert(action);
int dim = action->data().toInt();
KnobPtr knob = getKnob();
assert( knob->getHolder()->getApp() );
//get the current time on the global timeline
SequenceTime time = knob->getHolder()->getApp()->getTimeLine()->currentFrame();
AddKeysCommand::KeysToAddList toAdd;
KnobGuiPtr thisShared = shared_from_this();
for (int i = 0; i < knob->getDimension(); ++i) {
if ( (dim == -1) || (i == dim) ) {
std::list<boost::shared_ptr<CurveGui> > curves = getGui()->getCurveEditor()->findCurve(thisShared, i);
for (std::list<boost::shared_ptr<CurveGui> >::iterator it = curves.begin(); it != curves.end(); ++it) {
AddKeysCommand::KeyToAdd keyToAdd;
KeyFrame kf;
kf.setTime(time);
Knob<int>* isInt = dynamic_cast<Knob<int>*>( knob.get() );
Knob<bool>* isBool = dynamic_cast<Knob<bool>*>( knob.get() );
AnimatingKnobStringHelper* isString = dynamic_cast<AnimatingKnobStringHelper*>( knob.get() );
Knob<double>* isDouble = dynamic_cast<Knob<double>*>( knob.get() );
if (isInt) {
kf.setValue( isInt->getValue(i) );
} else if (isBool) {
kf.setValue( isBool->getValue(i) );
} else if (isDouble) {
kf.setValue( isDouble->getValue(i) );
} else if (isString) {
std::string v = isString->getValue(i);
double dv;
isString->stringToKeyFrameValue(time, ViewIdx(0), v, &dv);
kf.setValue(dv);
}
keyToAdd.keyframes.push_back(kf);
keyToAdd.curveUI = *it;
keyToAdd.knobUI = thisShared;
keyToAdd.dimension = i;
toAdd.push_back(keyToAdd);
}
}
}
pushUndoCommand( new AddKeysCommand(getGui()->getCurveEditor()->getCurveWidget(), toAdd) );
}
示例2: createKeyFrame
//----------------------------------------------------------------------------//
KeyFrame* Affector::createKeyFrame(float position, const String& value,
KeyFrame::Progression progression, const String& sourceProperty)
{
KeyFrame* ret = createKeyFrame(position);
ret->setValue(value);
ret->setProgression(progression);
ret->setSourceProperty(sourceProperty);
return ret;
}