Updates to build with USD 21.11.
This commit is contained in:
parent
8f17cb2052
commit
00aa4252c5
|
@ -54,8 +54,8 @@ void USDInstanceReader::set_instance_collection(Collection *coll)
|
|||
|
||||
pxr::SdfPath USDInstanceReader::proto_path() const
|
||||
{
|
||||
if (pxr::UsdPrim master = prim_.GetMaster()) {
|
||||
return master.GetPath();
|
||||
if (pxr::UsdPrim proto = prim_.GetPrototype()) {
|
||||
return proto.GetPath();
|
||||
}
|
||||
|
||||
return pxr::SdfPath();
|
||||
|
|
|
@ -60,16 +60,10 @@ using namespace blender::io::usd;
|
|||
|
||||
static std::string anchor_relative_path(pxr::UsdStagePtr stage, const std::string &asset_path)
|
||||
{
|
||||
if (asset_path.empty()) {
|
||||
if (asset_path.empty() || asset_path.front() != '.') {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
pxr::ArResolver &resolver = pxr::ArGetResolver();
|
||||
|
||||
if (!resolver.IsRelativePath(asset_path)) {
|
||||
return asset_path;
|
||||
}
|
||||
|
||||
// TODO(makowalski): avoid recomputing the USD path, if possible.
|
||||
pxr::SdfLayerHandle layer = stage->GetRootLayer();
|
||||
|
||||
|
@ -79,7 +73,11 @@ static std::string anchor_relative_path(pxr::UsdStagePtr stage, const std::strin
|
|||
return asset_path;
|
||||
}
|
||||
|
||||
return resolver.AnchorRelativePath(stage_path, asset_path);
|
||||
#if PXR_VERSION >= 2111
|
||||
return pxr::ArGetResolver().CreateIdentifier(asset_path, pxr::ArResolvedPath(stage_path));
|
||||
#else
|
||||
return pxr::ArGetResolver().AnchorRelativePath(stage_path, asset_path);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void print_obj(PyObject *obj)
|
||||
|
|
Loading…
Reference in New Issue