<s> import unittest <EOL> import IECore <EOL> import Gaffer <EOL> import GafferScene <EOL> import GafferSceneTest <EOL> class FreezeTransformTest ( GafferSceneTest . SceneTestCase ) : <EOL> def test ( self ) : <EOL> p = GafferScene . Plane ( ) <EOL> p [ "<STR_LIT>" ] [ "<STR_LIT>" ] . setValue ( IECore . V3f ( <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ) ) <EOL> t = GafferScene . FreezeTransform ( ) <EOL> t [ "<STR_LIT>" ] . setInput ( p [ "<STR_LIT>" ] ) <EOL> self . assertSceneValid ( t [ "<STR_LIT>" ] ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . transform ( "<STR_LIT>" ) , IECore . M44f ( ) ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . bound ( "<STR_LIT>" ) , IECore . Box3f ( IECore . V3f ( <NUM_LIT:0.5> , <NUM_LIT> , <NUM_LIT:3> ) , IECore . V3f ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:3> ) ) ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) . bound ( ) , IECore . Box3f ( IECore . V3f ( <NUM_LIT:0.5> , <NUM_LIT> , <NUM_LIT:3> ) , IECore . V3f ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:3> ) ) ) <EOL> def testFilter ( self ) : <EOL> p1 = GafferScene . Plane ( ) <EOL> p1 [ "<STR_LIT>" ] [ "<STR_LIT>" ] . setValue ( IECore . V3f ( <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ) ) <EOL> p2 = GafferScene . Plane ( ) <EOL> p2 [ "<STR_LIT>" ] [ "<STR_LIT>" ] . setValue ( IECore . V3f ( <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ) ) <EOL> g = GafferScene . Group ( ) <EOL> g [ "<STR_LIT>" ] [ "<STR_LIT>" ] . setValue ( IECore . V3f ( <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> g [ "<STR_LIT>" ] [ <NUM_LIT:0> ] . setInput ( p1 [ "<STR_LIT>" ] ) <EOL> g [ "<STR_LIT>" ] [ <NUM_LIT:1> ] . setInput ( p2 [ "<STR_LIT>" ] ) <EOL> f = GafferScene . PathFilter ( ) <EOL> f [ "<STR_LIT>" ] . setValue ( IECore . StringVectorData ( [ "<STR_LIT>" ] ) ) <EOL> t = GafferScene . FreezeTransform ( ) <EOL> t [ "<STR_LIT>" ] . setInput ( g [ "<STR_LIT>" ] ) <EOL> t [ "<STR_LIT>" ] . setInput ( f [ "<STR_LIT>" ] ) <EOL> self . assertSceneValid ( t [ "<STR_LIT>" ] ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . transform ( "<STR_LIT>" ) , IECore . M44f . createTranslated ( IECore . V3f ( <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> ) ) ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . transform ( "<STR_LIT>" ) , IECore . M44f ( ) ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . transform ( "<STR_LIT>" ) , IECore . M44f . createTranslated ( IECore . V3f ( <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ) ) ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . bound ( "<STR_LIT>" ) , IECore . Box3f ( IECore . V3f ( <NUM_LIT:0.5> , <NUM_LIT> , <NUM_LIT:3> ) , IECore . V3f ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:3> ) ) ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . bound ( "<STR_LIT>" ) , IECore . Box3f ( IECore . V3f ( - <NUM_LIT:0.5> , - <NUM_LIT:0.5> , <NUM_LIT:0> ) , IECore . V3f ( <NUM_LIT:0.5> , <NUM_LIT:0.5> , <NUM_LIT:0> ) ) ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) . bound ( ) , IECore . Box3f ( IECore . V3f ( <NUM_LIT:0.5> , <NUM_LIT> , <NUM_LIT:3> ) , IECore . V3f ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:3> ) ) ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . object ( "<STR_LIT>" ) . bound ( ) , IECore . Box3f ( IECore . V3f ( - <NUM_LIT:0.5> , - <NUM_LIT:0.5> , <NUM_LIT:0> ) , IECore . V3f ( <NUM_LIT:0.5> , <NUM_LIT:0.5> , <NUM_LIT:0> ) ) ) <EOL> f [ "<STR_LIT>" ] . setValue ( IECore . StringVectorData ( [ "<STR_LIT>" , "<STR_LIT>" ] ) ) <EOL> self . assertSceneValid ( t [ "<STR_LIT>" ] ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . transform ( "<STR_LIT>" ) , IECore . M44f ( ) ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . transform ( "<STR_LIT>" ) , IECore . M44f ( ) ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . transform ( "<STR_LIT>" ) , IECore . M44f . createTranslated ( IECore . V3f ( <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ) ) ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . bound ( "<STR_LIT>" ) , IECore . Box3f ( IECore . V3f ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:3> ) , IECore . V3f ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:3> ) ) ) <EOL> self . assertEqual ( t [ "<STR_LIT>" ] . bound ( "<STR_LIT>" ) , IECore . Box3f ( IECore . V3f ( <NUM_LIT:0.5> , - <NUM_LIT:0.5> , <NUM_LIT:0> ) , IECore . V3f ( <NUM_LIT> , <NUM_LIT:0.5> , <NUM_LIT:0> ) ) ) <EOL> def testAffects ( self ) : <EOL> t = GafferScene . FreezeTransform ( ) <EOL> self . assertEqual ( set ( t . affects ( t [ "<STR_LIT>" ] [ "<STR_LIT:object>" ] ) ) , set ( [ t [ "<STR_LIT>" ] [ "<STR_LIT:object>" ] ] ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
