def test( self ) : c = GafferScene.ClippingPlane() self.assertSceneValid( c["out"] ) self.assertEqual( c["out"].bound( "/clippingPlane" ), imath.Box3f( imath.V3f( -0.5, -0.5, 0 ), imath.V3f( 0.5 ) ) ) s = c["out"].set( "__clippingPlanes" ) self.assertEqual( s.value.paths(), [ "/clippingPlane" ] )
def testDirtyPropagation( self ) : c = GafferScene.ClippingPlane() dirtied = GafferTest.CapturingSlot( c.plugDirtiedSignal() ) c["transform"]["translate"]["x"].setValue( 10 ) self.failUnless( c["out"]["transform"] in [ p[0] for p in dirtied ] ) dirtied = GafferTest.CapturingSlot( c.plugDirtiedSignal() ) c["name"].setValue( "yupyup" ) self.failUnless( c["out"]["childNames"] in [ p[0] for p in dirtied ] ) self.failUnless( c["out"]["set"] in [ p[0] for p in dirtied ] )
def test(self): c = GafferScene.ClippingPlane() self.assertSceneValid(c["out"]) self.assertEqual( c["out"].bound("/clippingPlane"), IECore.Box3f(IECore.V3f(-0.5, -0.5, 0), IECore.V3f(0.5))) g = c["out"]["globals"].getValue() s = g["gaffer:sets"]["__clippingPlanes"] self.assertEqual(s.value.paths(), ["/clippingPlane"])
def testClippingPlane(self): s = Gaffer.ScriptNode() s["c"] = GafferScene.ClippingPlane() s["r"] = GafferRenderMan.RenderManRender() s["r"]["mode"].setValue("generate") s["r"]["ribFileName"].setValue("/tmp/test.rib") s["r"]["in"].setInput(s["c"]["out"]) s["r"].execute() rib = "\n".join(file("/tmp/test.rib").readlines()) self.assertTrue("ClippingPlane" in rib)