本文整理汇总了C++中SdfLayerHandle::GetRepositoryPath方法的典型用法代码示例。如果您正苦于以下问题:C++ SdfLayerHandle::GetRepositoryPath方法的具体用法?C++ SdfLayerHandle::GetRepositoryPath怎么用?C++ SdfLayerHandle::GetRepositoryPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SdfLayerHandle
的用法示例。
在下文中一共展示了SdfLayerHandle::GetRepositoryPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: regcomp
/* static */
void
UsdKatanaCache::_SetMutedLayers(
const UsdStageRefPtr &stage, const std::string &layerRegex)
{
// Trace this function to track its performance
TRACE_FUNCTION();
// Unmute layers that are currently muted, but not requested to be muted
SdfLayerHandleVector stageLayers = stage->GetUsedLayers();
bool regexIsEmpty = layerRegex == "" || layerRegex == "^$";
// use a better regex library?
regex_t regex;
regcomp(®ex, layerRegex.c_str(), REG_EXTENDED);
regmatch_t* rmatch = 0;
TF_FOR_ALL(stageLayer, stageLayers)
{
SdfLayerHandle layer = *stageLayer;
if (!layer) {
continue;
}
std::string layerPath = layer->GetRepositoryPath();
const std::string layerIdentifier = layer->GetIdentifier();
bool match = false;
if (!regexIsEmpty)
{
if (layer && !regexec(
®ex,
layerIdentifier.c_str(),
0, rmatch, 0))
{
match = true;
}
}
if (!match && stage->IsLayerMuted(layerIdentifier)) {
TF_DEBUG(USDKATANA_CACHE_RENDERER).Msg("{USD RENDER CACHE} "
"Unmuting Layer: '%s'\n",
layerIdentifier.c_str());
stage->UnmuteLayer(layerIdentifier);
}
if (match && !stage->IsLayerMuted(layerIdentifier)) {
TF_DEBUG(USDKATANA_CACHE_RENDERER).Msg("{USD RENDER CACHE} "
"Muting Layer: '%s'\n",
layerIdentifier.c_str());
stage->MuteLayer(layerIdentifier);
}
}