本文整理汇总了C++中OP_Context::getFloatFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ OP_Context::getFloatFrame方法的具体用法?C++ OP_Context::getFloatFrame怎么用?C++ OP_Context::getFloatFrame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OP_Context
的用法示例。
在下文中一共展示了OP_Context::getFloatFrame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cookMySop
OP_ERROR SOP_InterpolatedCacheReader::cookMySop( OP_Context &context )
{
flags().setTimeDep( true );
if ( lockInputs( context ) >= UT_ERROR_ABORT )
{
return error();
}
gdp->stashAll();
float time = context.getTime();
float frame = context.getFloatFrame();
UT_String paramVal;
evalString( paramVal, "cacheSequence", 0, time );
std::string cacheFileName = paramVal.toStdString();
evalString( paramVal, "objectFixes", 0, time );
std::string objectPrefix = paramVal.toStdString();
evalString( paramVal, "objectFixes", 1, time );
std::string objectSuffix = paramVal.toStdString();
evalString( paramVal, "attributeFixes", 0, time );
std::string attributePrefix = paramVal.toStdString();
evalString( paramVal, "attributeFixes", 1, time );
std::string attributeSuffix = paramVal.toStdString();
evalString( paramVal, "transformAttribute", 0, time );
std::string transformAttribute = paramVal.toStdString();
int samplesPerFrame = evalInt( "samplesPerFrame", 0, time );
InterpolatedCache::Interpolation interpolation = (InterpolatedCache::Interpolation)evalInt( "interpolation", 0, time );
GroupingMode groupingMode = (GroupingMode)evalInt( "groupingMode", 0, time );
// create the InterpolatedCache
if ( cacheFileName.compare( m_cacheFileName ) != 0 || samplesPerFrame != m_samplesPerFrame || interpolation != m_interpolation )
{
try
{
float fps = OPgetDirector()->getChannelManager()->getSamplesPerSec();
OversamplesCalculator calc( fps, samplesPerFrame );
m_cache = new InterpolatedCache( cacheFileName, interpolation, calc );
}
catch ( IECore::InvalidArgumentException e )
{
addWarning( SOP_ATTRIBUTE_INVALID, e.what() );
unlockInputs();
return error();
}
m_cacheFileName = cacheFileName;
m_samplesPerFrame = samplesPerFrame;
m_interpolation = interpolation;
}
if ( !m_cache )
{
addWarning( SOP_MESSAGE, "SOP_InterpolatedCacheReader: Cache Sequence not found" );
unlockInputs();
return error();
}
std::vector<InterpolatedCache::ObjectHandle> objects;
std::vector<InterpolatedCache::AttributeHandle> attrs;
try
{
m_cache->objects( frame, objects );
}
catch ( IECore::Exception e )
{
addWarning( SOP_ATTRIBUTE_INVALID, e.what() );
unlockInputs();
return error();
}
duplicatePointSource( 0, context );
GA_ElementGroupTable *groups = 0;
if ( groupingMode == PointGroup )
{
groups = &gdp->pointGroups();
}
else if ( groupingMode == PrimitiveGroup )
{
groups = &gdp->primitiveGroups();
}
for ( GA_GroupTable::iterator<GA_ElementGroup> it=groups->beginTraverse(); !it.atEnd(); ++it )
{
GA_ElementGroup *group = it.group();
if ( group->getInternal() || group->isEmpty() )
{
continue;
}
// match GA_ElementGroup name to InterpolatedCache::ObjectHandle
std::string searchName = objectPrefix + group->getName().toStdString() + objectSuffix;
//.........这里部分代码省略.........