Skip to content

Commit

Permalink
ArnoldShaderUITest : check behaviour for registered plug metadata
Browse files Browse the repository at this point in the history
When registering metadata for a specific plug, it shouldn't override the
metadata lookup on the base class for another plug.
  • Loading branch information
Matti Gruener committed Aug 19, 2019
1 parent 8af7e12 commit dd16f9f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion python/GafferArnoldUITest/ArnoldShaderUITest.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,16 @@ def testUserDefaultMetadata( self ) :
self.assertEqual( parms["uvcoords"].value, imath.V2f( 12, 13 ) )
self.assertEqual( parms["filename"].value, "overrideUserDefault" )
self.assertEqual( parms["filter"].value, "bilinear" )


def testBaseClassMetadataLookup( self ) :

surface = GafferArnold.ArnoldShader()
surface.loadShader( "standard_surface" )

# Make sure that metadata registration based on mechanism in GafferScene.ShaderUI works
Gaffer.Metadata.registerValue( "ai:surface:standard_surface:aov_id1", "userDefault", "id_1" )

self.assertEqual( Gaffer.Metadata.value( surface["parameters"]["aov_id1"], "userDefault" ), "id_1" )

if __name__ == "__main__":
unittest.main()

0 comments on commit dd16f9f

Please sign in to comment.