From 479029cd11b75b28a5fdceb634d87b251b55c252 Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Wed, 29 Jan 2025 14:34:17 -0800 Subject: [PATCH] Set Target Colorspace on context We found a Color Space diff in testUsdImagingGLMaterialXCustomNodes_customMaterial. The issue is that target colorspace should be set on the generator context instead of the document. Closes #3482 (Internal change: 2354861) --- pxr/imaging/hdSt/materialXFilter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pxr/imaging/hdSt/materialXFilter.cpp b/pxr/imaging/hdSt/materialXFilter.cpp index e2bb494d28..47ab29dfb8 100644 --- a/pxr/imaging/hdSt/materialXFilter.cpp +++ b/pxr/imaging/hdSt/materialXFilter.cpp @@ -224,10 +224,10 @@ HdSt_GenMaterialXShader( cms->loadLibrary(stdLibraries); mxContext.getShaderGenerator().setColorManagementSystem(cms); - // Set the colorspace - // XXX: This is the equivalent of the default source colorSpace, which does - // not yet have a schema and is therefore not yet accessable here - mxDoc->setColorSpace("lin_rec709"); + // Set the target colorspace + // XXX: This is equivalent to the scene referred color space, and is + // not yet accessible here + mxContext.getOptions().targetColorSpaceOverride = "lin_rec709"; // Add the Direct Light mtlx file to the mxDoc mx::DocumentPtr lightDoc = mx::createDocument();