Skip to content

Commit

Permalink
Merge pull request #6145 from johnhaddon/ocioTestTweak
Browse files Browse the repository at this point in the history
DisplayTransformTest : Don't rely on `$GAFFER_ROOT/openColorIO`
  • Loading branch information
johnhaddon authored Nov 14, 2024
2 parents 193e1cf + 8f0d8fc commit 8f8e83f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/GafferImageTest/DisplayTransformTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,16 @@ def testDisplayAndViewDefaultToConfig( self ) :

# Test alternative config

configPath = Gaffer.rootPath() / "openColorIO" / "config.ocio"
configPath = self.openColorIOPath() / "context.ocio"
config = PyOpenColorIO.Config.CreateFromFile( str( configPath ) )

explicitDisplayTransform["display"].setValue( config.getDefaultDisplay() )
explicitDisplayTransform["view"].setValue( config.getDefaultView( config.getDefaultDisplay() ) )

with Gaffer.Context() as context :
GafferImage.OpenColorIOAlgo.setConfig( context, configPath.as_posix() )
GafferImage.OpenColorIOAlgo.addVariable( context, "CDL", "rec709.spi1d" )
GafferImage.OpenColorIOAlgo.addVariable( context, "LUT", "cineon.spi1d" )
self.assertImagesEqual( defaultDisplayTransform["out"], explicitDisplayTransform["out"] )

if __name__ == "__main__":
Expand Down

0 comments on commit 8f8e83f

Please sign in to comment.