Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usdBakeMtlx: absorb TextureBakerGlsl API change to fix compilation with MaterialX 1.38.7 #2402

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pxr/usdImaging/bin/usdBakeMtlx/bakeMaterialX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "pxr/usd/usdShade/shader.h"

#include <MaterialXCore/Document.h>
#include <MaterialXCore/Generated.h>
#include <MaterialXCore/Node.h>
#include <MaterialXFormat/Util.h>
#include <MaterialXFormat/XmlIo.h>
Expand Down Expand Up @@ -144,8 +145,15 @@ void _BakeMtlxDocument(
: mx::Image::BaseType::UINT8;

// Construct a Texture Baker.
#if MATERIALX_MAJOR_VERSION <= 1 && \
MATERIALX_MINOR_VERSION <= 38 && \
MATERIALX_BUILD_VERSION <= 6
mx::TextureBakerPtr baker = mx::TextureBaker::create(
textureWidth, textureHeight, baseType);
#else
mx::TextureBakerPtr baker = mx::TextureBakerGlsl::create(
textureWidth, textureHeight, baseType);
#endif
baker->setupUnitSystem(stdLibraries);
baker->setAverageImages(bakeAverage);

Expand Down