#NEWLINE# def testHideLight( self ) : #NEWLINE# #INDENT# s = Gaffer . ScriptNode ( ) #NEWLINE# s [ 'l' ] = GafferRenderMan . RenderManLight ( ) #NEWLINE# s [ 'l' ] . loadShader ( 'pointlight' ) #NEWLINE# s [ 'l' ] [ 'transform' ] [ 'translate' ] [ 'z' ] . setValue ( 1 ) #NEWLINE# s [ 'v' ] = GafferScene . StandardAttributes ( ) #NEWLINE# s [ 'v' ] [ 'attributes' ] [ 'visibility' ] [ 'enabled' ] . setValue ( True ) #NEWLINE# s [ 'v' ] [ 'in' ] . setInput ( s [ 'l' ] [ 'out' ] ) #NEWLINE# s [ 'p' ] = GafferScene . Plane ( ) #NEWLINE# s [ 'c' ] = GafferScene . Camera ( ) #NEWLINE# s [ 'c' ] [ 'transform' ] [ 'translate' ] [ 'z' ] . setValue ( 1 ) #NEWLINE# s [ 'g' ] = GafferScene . Group ( ) #NEWLINE# s [ 'g' ] [ 'in' ] [ 0 ] . setInput ( s [ 'v' ] [ 'out' ] ) #NEWLINE# s [ 'g' ] [ 'in' ] [ 1 ] . setInput ( s [ 'p' ] [ 'out' ] ) #NEWLINE# s [ 'g' ] [ 'in' ] [ 2 ] . setInput ( s [ 'c' ] [ 'out' ] ) #NEWLINE# s [ 's' ] = GafferRenderMan . RenderManShader ( ) #NEWLINE# s [ 's' ] . loadShader ( 'matte' ) #NEWLINE# s [ 'a' ] = GafferScene . ShaderAssignment ( ) #NEWLINE# s [ 'a' ] [ 'in' ] . setInput ( s [ 'g' ] [ 'out' ] ) #NEWLINE# s [ 'a' ] [ 'shader' ] . setInput ( s [ 's' ] [ 'out' ] ) #NEWLINE# s [ 'd' ] = GafferScene . Outputs ( ) #NEWLINE# s [ 'd' ] . addOutput ( 'beauty' , IECore . Display ( 'test' , 'ieDisplay' , 'rgba' , { #NEWLINE# #INDENT# 'quantize' : IECore . FloatVectorData ( [ 0 , 0 , 0 , 0 ] ) , #NEWLINE# 'driverType' : 'ImageDisplayDriver' , #NEWLINE# 'handle' : 'myLovelyPlane' , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# s [ 'd' ] [ 'in' ] . setInput ( s [ 'a' ] [ 'out' ] ) #NEWLINE# s [ 'o' ] = GafferScene . StandardOptions ( ) #NEWLINE# s [ 'o' ] [ 'options' ] [ 'renderCamera' ] [ 'value' ] . setValue ( '/group/camera' ) #NEWLINE# s [ 'o' ] [ 'options' ] [ 'renderCamera' ] [ 'enabled' ] . setValue ( True ) #NEWLINE# s [ 'o' ] [ 'in' ] . setInput ( s [ 'd' ] [ 'out' ] ) #NEWLINE# s [ 'r' ] = GafferRenderMan . InteractiveRenderManRender ( ) #NEWLINE# s [ 'r' ] [ 'in' ] . setInput ( s [ 'o' ] [ 'out' ] ) #NEWLINE# s [ 'r' ] [ 'state' ] . setValue ( s [ 'r' ] . State . Running ) #NEWLINE# time . sleep ( 2 ) #NEWLINE# c = self . __colorAtUV ( IECore . ImageDisplayDriver . storedImage ( 'myLovelyPlane' ) , IECore . V2f ( 0.5 ) ) #NEWLINE# self . assertNotEqual ( c [ 0 ] , 0.0 ) #NEWLINE# s [ 'v' ] [ 'attributes' ] [ 'visibility' ] [ 'value' ] . setValue ( False ) #NEWLINE# time . sleep ( 2 ) #NEWLINE# c = self . __colorAtUV ( IECore . ImageDisplayDriver . storedImage ( 'myLovelyPlane' ) , IECore . V2f ( 0.5 ) ) #NEWLINE# self . assertEqual ( c [ 0 ] , 0.0 ) #NEWLINE# s [ 'v' ] [ 'attributes' ] [ 'visibility' ] [ 'value' ] . setValue ( True ) #NEWLINE# time . sleep ( 2 ) #NEWLINE# c = self . __colorAtUV ( IECore . ImageDisplayDriver . storedImage ( 'myLovelyPlane' ) , IECore . V2f ( 0.5 ) ) #NEWLINE# self . assertNotEqual ( c [ 0 ] , 0.0 )