Skip to content

Commit

Permalink
Restore original function as well, since the RenderMan plugin uses th…
Browse files Browse the repository at this point in the history
…at API
  • Loading branch information
robp-sidefx committed Jan 20, 2025
1 parent ba6e7fe commit 49f568a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pxr/imaging/hd/materialSchema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ HdMaterialSchema::GetMaterialNetwork()
HdMaterialSchemaTokens->universalRenderContext));
}

HdMaterialNetworkSchema
HdMaterialSchema::GetMaterialNetwork(TfToken const &context)
{
if (auto b = _GetTypedDataSource<HdContainerDataSource>(context)) {
return HdMaterialNetworkSchema(b);
}

// If we can't find the context-specific binding, return the fallback.
return
HdMaterialNetworkSchema(
_GetTypedDataSource<HdContainerDataSource>(
HdMaterialSchemaTokens->universalRenderContext));
}

HdMaterialNetworkSchema
HdMaterialSchema::GetMaterialNetwork(TfTokenVector const &contexts)
{
Expand Down
3 changes: 3 additions & 0 deletions pxr/imaging/hd/materialSchema.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ class HdMaterialSchema : public HdSchema
HD_API
HdMaterialNetworkSchema GetMaterialNetwork();

HD_API
HdMaterialNetworkSchema GetMaterialNetwork(TfToken const &context);

HD_API
HdMaterialNetworkSchema GetMaterialNetwork(TfTokenVector const &contexts);

Expand Down

0 comments on commit 49f568a

Please sign in to comment.