本文整理汇总了C++中UsdRelationship::GetName方法的典型用法代码示例。如果您正苦于以下问题:C++ UsdRelationship::GetName方法的具体用法?C++ UsdRelationship::GetName怎么用?C++ UsdRelationship::GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UsdRelationship
的用法示例。
在下文中一共展示了UsdRelationship::GetName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TfStringPrintf
static string
__repr__(const UsdRelationship &self)
{
if (self) {
return TfStringPrintf("%s.GetRelationship(%s)",
TfPyRepr(self.GetPrim()).c_str(),
TfPyRepr(self.GetName()).c_str());
} else {
return "invalid " + self.GetDescription();
}
}
示例2: UsdPrim
PXR_NAMESPACE_OPEN_SCOPE
// TODO: We should centralize this logic in a UsdImaging ShaderAdapter.
/*static*/
UsdPrim
UsdImaging_MaterialStrategy::GetTargetedShader(UsdPrim const& materialPrim,
UsdRelationship const& materialRel)
{
SdfPathVector targets;
if (!materialRel.GetForwardedTargets(&targets))
return UsdPrim();
if (targets.size() != 1) {
// XXX: This should really be a validation error once USD gets that
// feature.
TF_WARN("We expect only one target on relationship %s of prim <%s>, "
"but got %zu.",
materialRel.GetName().GetText(),
materialPrim.GetPath().GetText(),
targets.size());
return UsdPrim();
}
if (!targets[0].IsPrimPath()) {
// XXX: This should really be a validation error once USD gets that
// feature.
TF_WARN("We expect the target of the relationship %s of prim <%s> "
"to be a prim, instead it is <%s>.",
materialRel.GetName().GetText(),
materialPrim.GetPath().GetText(),
targets[0].GetText());
return UsdPrim();
}
return materialPrim.GetStage()->GetPrimAtPath(targets[0]);
}