[Bf-blender-cvs] [b1235c58586] tmp-usd-mak-c87f6242: Fixed USD 21.11 compile errors.
Michael Kowalski
noreply at git.blender.org
Mon May 2 03:31:53 CEST 2022
Commit: b1235c58586b8871f5b2a8e692dbb34f45289a28
Author: Michael Kowalski
Date: Sun May 1 21:30:50 2022 -0400
Branches: tmp-usd-mak-c87f6242
https://developer.blender.org/rBb1235c58586b8871f5b2a8e692dbb34f45289a28
Fixed USD 21.11 compile errors.
===================================================================
M source/blender/io/usd/intern/usd_umm.cc
===================================================================
diff --git a/source/blender/io/usd/intern/usd_umm.cc b/source/blender/io/usd/intern/usd_umm.cc
index 24d236208fc..95d7774d325 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, 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