[Bf-blender-cvs] [00aa4252c51] universal-scene-description: Updates to build with USD 21.11.
Michael Kowalski
noreply at git.blender.org
Tue May 3 02:24:17 CEST 2022
Commit: 00aa4252c51766f28f174653030be07a87f39e85
Author: Michael Kowalski
Date: Mon May 2 20:22:01 2022 -0400
Branches: universal-scene-description
https://developer.blender.org/rB00aa4252c51766f28f174653030be07a87f39e85
Updates to build with USD 21.11.
===================================================================
M source/blender/io/usd/intern/usd_reader_instance.cc
M source/blender/io/usd/intern/usd_umm.cc
===================================================================
diff --git a/source/blender/io/usd/intern/usd_reader_instance.cc b/source/blender/io/usd/intern/usd_reader_instance.cc
index 5ee4cc7e9a7..070ad47a872 100644
--- a/source/blender/io/usd/intern/usd_reader_instance.cc
+++ b/source/blender/io/usd/intern/usd_reader_instance.cc
@@ -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();
diff --git a/source/blender/io/usd/intern/usd_umm.cc b/source/blender/io/usd/intern/usd_umm.cc
index 24d236208fc..c648c2f2c23 100644
--- a/source/blender/io/usd/intern/usd_umm.cc
+++ b/source/blender/io/usd/intern/usd_umm.cc
@@ -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)
More information about the Bf-blender-cvs
mailing list