diff --git a/lib/mayaUsd/render/MaterialXGenOgsXml/GlslOcioNodeImpl.cpp b/lib/mayaUsd/render/MaterialXGenOgsXml/GlslOcioNodeImpl.cpp index 474383167d..f2bbe7682c 100644 --- a/lib/mayaUsd/render/MaterialXGenOgsXml/GlslOcioNodeImpl.cpp +++ b/lib/mayaUsd/render/MaterialXGenOgsXml/GlslOcioNodeImpl.cpp @@ -25,6 +25,7 @@ #include #include +#include #include MATERIALX_NAMESPACE_BEGIN diff --git a/lib/mayaUsd/render/vp2RenderDelegate/material.cpp b/lib/mayaUsd/render/vp2RenderDelegate/material.cpp index f2aaede226..b52c944a21 100644 --- a/lib/mayaUsd/render/vp2RenderDelegate/material.cpp +++ b/lib/mayaUsd/render/vp2RenderDelegate/material.cpp @@ -2663,11 +2663,12 @@ TfToken _RequiresColorManagement( for (auto&& csAttrName : _knownColorSpaceAttrs) { auto paramIt = n.parameters.find(csAttrName); if (paramIt != n.parameters.end()) { - if (paramIt->second.IsHolding()) { - sourceColorSpace = paramIt->second.UncheckedGet().GetString(); + const VtValue& val = paramIt->second; + if (val.IsHolding()) { + sourceColorSpace = val.UncheckedGet().GetString(); return; - } else if (paramIt->second.IsHolding()) { - sourceColorSpace = paramIt->second.UncheckedGet(); + } else if (val.IsHolding()) { + sourceColorSpace = val.UncheckedGet(); return; } }