Skip to content

Commit

Permalink
Add support for older MaterialX versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
JGamache-autodesk committed Dec 5, 2024
1 parent 964f5c1 commit fe07c89
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/mayaUsd/render/MaterialXGenOgsXml/ShaderGenUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,16 @@ void TopoNeutralGraph::computeGraph(const mx::ElementPtr& material, bool texture

// In textured mode we traverse everything, but in untextured mode we only traverse PBR
// level connections.
static const auto kPbrConnectionTypes
= std::set<std::string> { mx::BSDF_TYPE_STRING,
mx::EDF_TYPE_STRING,
mx::VDF_TYPE_STRING,
mx::SURFACE_SHADER_TYPE_STRING,
mx::DISPLACEMENT_SHADER_TYPE_STRING,
mx::VOLUME_SHADER_TYPE_STRING };
static const auto kPbrConnectionTypes = std::set<std::string>
{
#if MX_COMBINED_VERSION >= 13807
mx::BSDF_TYPE_STRING, mx::EDF_TYPE_STRING, mx::VDF_TYPE_STRING,
#else
"BSDF", "EDF", "VDF",
#endif
mx::SURFACE_SHADER_TYPE_STRING, mx::DISPLACEMENT_SHADER_TYPE_STRING,
mx::VOLUME_SHADER_TYPE_STRING
};

if (!textured && kPbrConnectionTypes.count(sourceInput->getType()) == 0) {
connectedNode = nullptr;
Expand Down

0 comments on commit fe07c89

Please sign in to comment.