diff --git a/Changes b/Changes index d2b04a9a76..18564d6106 100644 --- a/Changes +++ b/Changes @@ -15,9 +15,11 @@ Build - Added `PYBIND11_INCLUDE_PATH` option. - Added `VDB_PYTHON_PATH` to USD tests. - Added `INSTALL_CREATE_SYMLINKS`, which allows you to disable the creation of version symlinks at the end of the install. + - Added `USG_SHIMLIB_PATH` which may be necessary to run nuke tests. - CI : - IECoreHoudini tests updated to pass on newer environments. + - IECoreGL tests updated with relaxed precisions for image comparisons. 10.5.10.0 (relative to 10.5.9.5) ========= diff --git a/SConstruct b/SConstruct index e2b5ac9a14..d359269e9a 100644 --- a/SConstruct +++ b/SConstruct @@ -353,6 +353,13 @@ o.Add( "", ) +o.Add( + "USG_SHIMLIB_PATH", + "The path to the FnUsdShim to use for Nuke. This may be necessary to run the tests.", + "", +) + + # OpenGL options try : @@ -2589,6 +2596,7 @@ nukeTestEnv["ENV"]["NUKE_PATH"] = "plugins/nuke" nukeTestEnv["ENV"]["IECORE_OP_PATHS"] = "test/IECoreNuke/ops:test/IECore/ops" # prepend OIIO LIB PATH to library path to support custom OIIO with specific dependencies nukeTestEnv["ENV"][libraryPathEnvVar] = "{}:{}".format( nukeTestEnv.subst( "$OIIO_LIB_PATH" ), nukeTestEnv["ENV"][libraryPathEnvVar] ) +nukeTestEnv["ENV"]["USG_SHIMLIB_PATH"] = nukeTestEnv["USG_SHIMLIB_PATH"] if doConfigure : diff --git a/config/ie/options b/config/ie/options index f4868268ff..f345f6d331 100644 --- a/config/ie/options +++ b/config/ie/options @@ -366,31 +366,18 @@ VDB_INCLUDE_PATH = os.path.join( VDB_LIB_PATH = os.path.join( "/software", "apps", "OpenVDB", vdbVersion, platform, compiler, compilerVersion, "lib" ) -if LooseVersion(vdbVersion) < LooseVersion("10") and targetApp: - VDB_PYTHON_PATH = os.path.join( - "/software", - "apps", - "OpenVDB", - vdbVersion, - platform, - compiler, - compilerVersion, - "python", - "lib", - "python" + pythonVersion, - ) - -else: - VDB_PYTHON_PATH = os.path.join( - "/software", - "apps", - "OpenVDB", - vdbVersion, - platform, - compiler, - compilerVersion, - "python", - ) +VDB_PYTHON_PATH = os.path.join( + "/software", + "apps", + "OpenVDB", + vdbVersion, + platform, + compiler, + compilerVersion, + "python", + "lib", + "python" + pythonVersion, +) PYBIND11_INCLUDE_PATH = os.path.join( @@ -513,6 +500,15 @@ if targetApp == "nuke": nukeReg = IEEnv.registry["apps"]["nuke"][nukeVersion][platform] NUKE_ROOT = nukeReg["location"] NUKE_LICENSE_FILE = nukeReg["wrapperEnvVars"]["foundry_LICENSE"] + USG_SHIMLIB_PATH = os.path.join( + "/software", + "apps", + "FnUsdShim", + nukeReg["compatibilityVersion"], + platform, + compiler, + compilerVersion, + ) INSTALL_NUKELIB_NAME = os.path.join(appPrefix, "lib", "$IECORE_NAME{}".format(ieCoreLibSuffix)) INSTALL_NUKEPYTHON_DIR = os.path.join(appPrefix, "python") INSTALL_NUKEICON_DIR = os.path.join(appPrefix, "icons") diff --git a/test/IECoreGL/Camera.py b/test/IECoreGL/Camera.py index 9840160f62..8476a25b25 100644 --- a/test/IECoreGL/Camera.py +++ b/test/IECoreGL/Camera.py @@ -64,7 +64,7 @@ def testPositioning( self ) : i = IECore.Reader.create( os.path.join( os.path.dirname( __file__ ), "output", "testCamera.tif" ) ).read() dimensions = i.dataWindow.size() + imath.V2i( 1 ) midpoint = dimensions.x * dimensions.y//2 + dimensions.x//2 - self.assertEqual( i["G"][midpoint], 0 ) + self.assertAlmostEqual( i["G"][midpoint], 0, 6 ) # render a plane at z = 0 with the camera moved back a touch to see it r = IECoreGL.Renderer() @@ -87,7 +87,7 @@ def testPositioning( self ) : i = IECore.Reader.create( os.path.join( os.path.dirname( __file__ ), "output", "testCamera.tif" ) ).read() dimensions = i.dataWindow.size() + imath.V2i( 1 ) midpoint = dimensions.x * dimensions.y//2 + dimensions.x//2 - self.assertEqual( i["A"][midpoint], 1 ) + self.assertAlmostEqual( i["A"][midpoint], 1, 6 ) def testXYOrientation( self ) : @@ -113,15 +113,15 @@ def testXYOrientation( self ) : i = IECore.Reader.create( os.path.join( os.path.dirname( __file__ ), "output", "testCamera.tif" ) ).read() dimensions = i.dataWindow.size() + imath.V2i( 1 ) index = dimensions.x * dimensions.y//2 + dimensions.x - 1 - self.assertEqual( i["A"][index], 1 ) + self.assertAlmostEqual( i["A"][index], 1, 6 ) self.assertAlmostEqual( i["R"][index], 1, 6 ) - self.assertEqual( i["G"][index], 0 ) - self.assertEqual( i["B"][index], 0 ) + self.assertAlmostEqual( i["G"][index], 0, 6 ) + self.assertAlmostEqual( i["B"][index], 0, 6 ) index = dimensions.x//2 - self.assertEqual( i["A"][index], 1 ) - self.assertEqual( i["R"][index], 0 ) + self.assertAlmostEqual( i["A"][index], 1, 6 ) + self.assertAlmostEqual( i["R"][index], 0, 6 ) self.assertAlmostEqual( i["G"][index], 1, 6 ) - self.assertEqual( i["B"][index], 0 ) + self.assertAlmostEqual( i["B"][index], 0, 6 ) def setUp( self ) : diff --git a/test/IECoreGL/ImmediateRenderer.py b/test/IECoreGL/ImmediateRenderer.py index d381690d28..d97acac24b 100644 --- a/test/IECoreGL/ImmediateRenderer.py +++ b/test/IECoreGL/ImmediateRenderer.py @@ -76,20 +76,20 @@ def test( self ) : i = IECore.Reader.create( outputFileName ).read() dimensions = i.dataWindow.size() + imath.V2i( 1 ) index = int(dimensions.x * 0.5) - self.assertEqual( i["A"][index], 1 ) + self.assertAlmostEqual( i["A"][index], 1, 6 ) self.assertAlmostEqual( i["R"][index], 1, 6 ) self.assertAlmostEqual( i["G"][index], 1, 6 ) - self.assertEqual( i["B"][index], 0 ) + self.assertAlmostEqual( i["B"][index], 0, 6 ) index = dimensions.x * int(dimensions.y * 0.5) + int(dimensions.x * 0.5) - self.assertEqual( i["A"][index], 1 ) - self.assertEqual( i["R"][index], 0 ) - self.assertEqual( i["G"][index], 0 ) + self.assertAlmostEqual( i["A"][index], 1, 6 ) + self.assertAlmostEqual( i["R"][index], 0, 6 ) + self.assertAlmostEqual( i["G"][index], 0, 6 ) self.assertAlmostEqual( i["B"][index], 1, 6 ) index = 0 - self.assertEqual( i["A"][index], 0 ) - self.assertEqual( i["R"][index], 0 ) - self.assertEqual( i["G"][index], 0 ) - self.assertEqual( i["B"][index], 0 ) + self.assertAlmostEqual( i["A"][index], 0, 6 ) + self.assertAlmostEqual( i["R"][index], 0, 6 ) + self.assertAlmostEqual( i["G"][index], 0, 6 ) + self.assertAlmostEqual( i["B"][index], 0, 6 ) def setUp( self ) : diff --git a/test/IECoreGL/MeshPrimitiveTest.py b/test/IECoreGL/MeshPrimitiveTest.py index 7fdd3f6eea..4e4aad7546 100644 --- a/test/IECoreGL/MeshPrimitiveTest.py +++ b/test/IECoreGL/MeshPrimitiveTest.py @@ -158,13 +158,13 @@ def testUniformCs( self ) : dimensions = image.dataWindow.size() + imath.V2i( 1 ) index = dimensions.x * int(dimensions.y * 0.75) + int(dimensions.x * 0.25) self.assertAlmostEqual( image["R"][index], 1, 6 ) - self.assertEqual( image["G"][index], 0 ) - self.assertEqual( image["B"][index], 0 ) + self.assertAlmostEqual( image["G"][index], 0, 6 ) + self.assertAlmostEqual( image["B"][index], 0, 6 ) index = dimensions.x * int(dimensions.y * 0.75) + int(dimensions.x * 0.75) - self.assertEqual( image["R"][index], 0 ) + self.assertAlmostEqual( image["R"][index], 0, 6 ) self.assertAlmostEqual( image["G"][index], 1, 6 ) - self.assertEqual( image["B"][index], 0 ) + self.assertAlmostEqual( image["B"][index], 0, 6 ) index = dimensions.x * int(dimensions.y * 0.25) + int(dimensions.x * 0.75) self.assertAlmostEqual( image["R"][index], 1, 6 ) @@ -172,8 +172,8 @@ def testUniformCs( self ) : self.assertAlmostEqual( image["B"][index], 1, 6 ) index = dimensions.x * int(dimensions.y * 0.25) + int(dimensions.x * 0.25) - self.assertEqual( image["R"][index], 0 ) - self.assertEqual( image["G"][index], 0 ) + self.assertAlmostEqual( image["R"][index], 0, 6 ) + self.assertAlmostEqual( image["G"][index], 0, 6 ) self.assertAlmostEqual( image["B"][index], 1, 6 ) def testBound( self ) : @@ -192,10 +192,10 @@ def testFaceNormals( self ) : #include "IECoreGL/FragmentShader.h" IECOREGL_FRAGMENTSHADER_IN vec3 fragmentN; - void main() - { - gl_FragColor = vec4( fragmentN, 1.0 ); - } + void main() + { + gl_FragColor = vec4( fragmentN, 1.0 ); + } """ r = IECoreGL.Renderer() @@ -224,8 +224,8 @@ def testFaceNormals( self ) : image = IECore.Reader.create( self.outputFileName ).read() dimensions = image.dataWindow.size() + imath.V2i( 1 ) index = dimensions.x * dimensions.y//2 + dimensions.x//2 - self.assertEqual( image["R"][index], 0 ) - self.assertEqual( image["G"][index], 0 ) + self.assertAlmostEqual( image["R"][index], 0, 6 ) + self.assertAlmostEqual( image["G"][index], 0, 6 ) self.assertAlmostEqual( image["B"][index], 1, 6 ) def testIndexedUV( self ) : diff --git a/test/IECoreGL/Renderer.py b/test/IECoreGL/Renderer.py index e977c2f879..effdd751ca 100644 --- a/test/IECoreGL/Renderer.py +++ b/test/IECoreGL/Renderer.py @@ -282,17 +282,17 @@ def testStackBug( self ) : index = dimensions.x * int(dimensions.y * 0.5) + int(dimensions.x * 0.5) self.assertAlmostEqual( i["R"][index], 1, 6 ) self.assertAlmostEqual( i["G"][index], 1, 6 ) - self.assertEqual( i["B"][index], 0 ) + self.assertAlmostEqual( i["B"][index], 0, 6 ) index = dimensions.x * int(dimensions.y * 0.5) self.assertAlmostEqual( i["R"][index], 1, 6 ) - self.assertEqual( i["G"][index], 0 ) - self.assertEqual( i["B"][index], 0 ) + self.assertAlmostEqual( i["G"][index], 0, 6 ) + self.assertAlmostEqual( i["B"][index], 0, 6 ) index = dimensions.x * int(dimensions.y * 0.5) + int(dimensions.x * 1) - 1 self.assertAlmostEqual( i["R"][index], 1, 6 ) - self.assertEqual( i["G"][index], 0 ) - self.assertEqual( i["B"][index], 0 ) + self.assertAlmostEqual( i["G"][index], 0, 6 ) + self.assertAlmostEqual( i["B"][index], 0, 6 ) def testPrimVars( self ) : @@ -345,18 +345,18 @@ def testPrimVars( self ) : i = IECore.Reader.create( os.path.join( os.path.dirname( __file__ ), "output", "testPrimVars.tif" ) ).read() dimensions = i.dataWindow.size() + imath.V2i( 1 ) index = dimensions.x * int(dimensions.y * 0.5) - self.assertEqual( i["R"][index], 0 ) + self.assertAlmostEqual( i["R"][index], 0, 6 ) self.assertAlmostEqual( i["G"][index], 1, 6 ) - self.assertEqual( i["B"][index], 0 ) + self.assertAlmostEqual( i["B"][index], 0, 6 ) index = dimensions.x * int(dimensions.y * 0.5) + int(dimensions.x * 0.5) self.assertAlmostEqual( i["R"][index], 1, 6 ) - self.assertEqual( i["G"][index], 0 ) - self.assertEqual( i["B"][index], 0 ) + self.assertAlmostEqual( i["G"][index], 0, 6 ) + self.assertAlmostEqual( i["B"][index], 0, 6 ) index = dimensions.x * int(dimensions.y * 0.5) + int(dimensions.x * 1) - 1 - self.assertEqual( i["R"][index], 0 ) - self.assertEqual( i["G"][index], 0 ) + self.assertAlmostEqual( i["R"][index], 0, 6 ) + self.assertAlmostEqual( i["G"][index], 0, 6 ) self.assertAlmostEqual( i["B"][index], 1, 6 ) ## \todo Make this assert something diff --git a/test/IECoreGL/ShadingTest.py b/test/IECoreGL/ShadingTest.py index 0720e2fb1a..9cffe9f290 100644 --- a/test/IECoreGL/ShadingTest.py +++ b/test/IECoreGL/ShadingTest.py @@ -825,10 +825,11 @@ def testVertexCsDoesntAffectWireframe( self ) : # wireframe is green, and vertex Cs is black, # so there should be no contribution from # wireframe or solid shading in the red channel. - self.assertEqual( sum( image["R"] ), 0 ) + self.assertAlmostEqual( sum( image["R"] ), 0, 4 ) # black vertex colour should have no effect on # green wireframe, so we should have some wireframe # contribution in the green channel. + self.assertNotAlmostEqual( sum( image["G"] ), 0, 4 ) self.assertTrue( sum( image["G"] ) > 0 ) def testUniformFloatArrayParameters( self ) :