MCPcopy Create free account
hub / github.com/DiligentGraphics/DiligentFX / ResolveAssetPath

Function ResolveAssetPath

Hydrogent/src/HnMaterialNetwork.cpp:451–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451std::string ResolveAssetPath(const pxr::VtValue& Value)
452{
453 // Note that the SdfAssetPath should really be resolved into an ArAsset via
454 // ArGetResolver (Eg. USDZ). Using GetResolvePath directly isn't sufficient.
455 // Texture loading goes via Glf, which will handle the ArAsset
456 // resolution already, so we skip doing it here and simply use the string.
457 if (Value.IsHolding<pxr::SdfAssetPath>())
458 {
459 pxr::SdfAssetPath SdfPath = Value.Get<pxr::SdfAssetPath>();
460 std::string PathStr = SdfPath.GetResolvedPath();
461 if (PathStr.empty())
462 {
463 PathStr = SdfPath.GetAssetPath();
464 }
465 return PathStr;
466 }
467 else if (Value.IsHolding<std::string>())
468 {
469 return Value.UncheckedGet<std::string>();
470 }
471
472 return std::string{};
473}
474
475pxr::HdWrap ResolveWrapSamplerParameter(const pxr::SdfPath& NodePath,
476 const pxr::HdMaterialNode2& Node,

Callers 1

AddTextureParamMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected