本文整理汇总了C++中CurvePtr::getKeyFramesCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CurvePtr::getKeyFramesCount方法的具体用法?C++ CurvePtr::getKeyFramesCount怎么用?C++ CurvePtr::getKeyFramesCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CurvePtr
的用法示例。
在下文中一共展示了CurvePtr::getKeyFramesCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toAnimationModule
void
NodeAnimPrivate::computeGroupRange()
{
NodeGuiPtr nodeUI = nodeGui.lock();
NodePtr node = nodeUI->getNode();
if (!node) {
return;
}
AnimationModulePtr isAnimModel = toAnimationModule(model.lock());
if (!isAnimModel) {
return;
}
NodeGroupPtr nodegroup = node->isEffectNodeGroup();
assert(nodegroup);
if (!nodegroup) {
return;
}
AnimationModuleTreeView* treeView = isAnimModel->getEditor()->getTreeView();
NodesList nodes = nodegroup->getNodes();
std::set<double> times;
for (NodesList::const_iterator it = nodes.begin(); it != nodes.end(); ++it) {
NodeAnimPtr childAnim = isAnimModel->findNodeAnim(*it);
if (!childAnim) {
continue;
}
if (!treeView->isItemVisibleRecursive(childAnim->getTreeItem())) {
continue;
}
childAnim->refreshFrameRange();
RangeD childRange = childAnim->getFrameRange();
times.insert(childRange.min);
times.insert(childRange.max);
// Also check the child knobs keyframes
NodeGuiPtr childGui = childAnim->getNodeGui();
const KnobsVec &knobs = childGui->getNode()->getKnobs();
for (KnobsVec::const_iterator it2 = knobs.begin(); it2 != knobs.end(); ++it2) {
if ( !(*it2)->isAnimationEnabled() || !(*it2)->hasAnimation() ) {
continue;
} else {
// For each dimension and for each split view get the first/last keyframe (if any)
int nDims = (*it2)->getNDimensions();
std::list<ViewIdx> views = (*it2)->getViewsList();
for (std::list<ViewIdx>::const_iterator it3 = views.begin(); it3 != views.end(); ++it3) {
for (int i = 0; i < nDims; ++i) {
CurvePtr curve = (*it2)->getCurve(*it3, DimIdx(i));
if (!curve) {
continue;
}
int nKeys = curve->getKeyFramesCount();
if (nKeys > 0) {
KeyFrame k;
if (curve->getKeyFrameWithIndex(0, &k)) {
times.insert( k.getTime() );
}
if (curve->getKeyFrameWithIndex(nKeys - 1, &k)) {
times.insert( k.getTime() );
}
}
}
}
}
} // for all knobs
} // for all children nodes
if (times.size() <= 1) {
frameRange.min = 0;
frameRange.max = 0;
} else {
frameRange.min = *times.begin();
frameRange.max = *times.rbegin();
}
} // computeGroupRange