本文整理汇总了C++中UsdPrim::GetDescendants方法的典型用法代码示例。如果您正苦于以下问题:C++ UsdPrim::GetDescendants方法的具体用法?C++ UsdPrim::GetDescendants怎么用?C++ UsdPrim::GetDescendants使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UsdPrim
的用法示例。
在下文中一共展示了UsdPrim::GetDescendants方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
SdfPath
UsdImagingMaterialAdapter::Populate(UsdPrim const& prim,
UsdImagingIndexProxy* index,
UsdImagingInstancerContext const* instancerContext)
{
// Since material are populated by reference, they need to take care not to
// be populated multiple times.
SdfPath cachePath = prim.GetPath();
if (index->IsPopulated(cachePath)) {
return cachePath;
}
index->InsertSprim(HdPrimTypeTokens->material,
cachePath,
prim, shared_from_this());
HD_PERF_COUNTER_INCR(UsdImagingTokens->usdPopulatedPrimCount);
// Also register this adapter on behalf of any descendent
// UsdShadeShader prims, since they are consumed to
// create the material network.
for (UsdPrim const& child: prim.GetDescendants()) {
if (child.IsA<UsdShadeShader>()) {
index->AddPrimInfo(child.GetPath(), child, shared_from_this());
}
}
return prim.GetPath();
}
示例2: _VisitSubtree
void _VisitSubtree(UsdPrim const &prim) {
_VisitPrim(prim);
auto range = prim.GetDescendants();
WorkParallelForEach(range.begin(), range.end(),
[this](UsdPrim const &desc) { _VisitPrim(desc); });
}