Skip to content

Commit

Permalink
Minor changes as a follow up to CL 2248469
Browse files Browse the repository at this point in the history
Fixes #1786

(Internal change: 2248713)
  • Loading branch information
klucknav authored and pixar-oss committed Sep 14, 2022
1 parent bebcab6 commit 5b00190
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions pxr/imaging/hdMtlx/hdMtlx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ _AddMaterialXNode(

// For each of the HdNode parameters add the corresponding parameter/input
// to the mxNode
bool hasFilenameInput = false;
TfTokenVector hdNodeParamNames =
netInterface->GetAuthoredNodeParameterNames(hdNodeName);
for (TfToken const &paramName : hdNodeParamNames) {
Expand All @@ -240,7 +239,6 @@ _AddMaterialXNode(
mx::InputPtr mxInput = mxNodeDef->getActiveInput(mxInputName);
if (mxInput) {
mxInputType = mxInput->getType();
hasFilenameInput |= mxInputType == "filename";
}
std::string mxInputValue = HdMtlxConvertToString(
netInterface->GetNodeParameterValue(hdNodeName, paramName));
Expand All @@ -249,7 +247,7 @@ _AddMaterialXNode(
}

// MaterialX nodes that use textures are assumed to have a filename input
if (hasFilenameInput) {
if (mxNodeDef->getNodeGroup() == "texture2d") {
if (mxHdData) {
// Save the corresponding MaterialX and Hydra names for ShaderGen
mxHdData->mxHdTextureMap[mxNodeName] = connectionName;
Expand Down
5 changes: 2 additions & 3 deletions pxr/usd/usdMtlx/overview.dox
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ get mapped is still undecided.
containing folder is indicated with the PXR_MTLX_PLUGIN_SEARCH_PATHS
environment variable.
+ Library defined custom nodes that use textures need to set the nodegroup
on the nodedef to 'texture2d', and make sure the 'filename' input is
exposed so the texture coordinates are available, and textures are properly
initialized for rendering.
on the nodedef to 'texture2d', and make sure the 'filename' typed input is
exposed so renderers can recognize the texture references.

\section usdMtlx_unsupported Unsupported MaterialX Features

Expand Down

0 comments on commit 5b00190

Please sign in to comment.