3838import tempfile
3939import unittest
4040
41-
42- import pxr
41+ import pxr . Usd
42+ import pxr . Sdf
4343
4444import imath
4545
@@ -91,7 +91,7 @@ def _writeScene( self, fileName, transformRootChildren=False, writeInvalidUSDNam
9191
9292 if transformRootChildren :
9393 t .writeTransform ( IECore .M44dData (imath .M44d ().translate (imath .V3d ( 2 , 0 , 0 ))), 2.0 )
94-
94+
9595 boxA = IECoreScene .MeshPrimitive .createBox ( imath .Box3f ( imath .V3f ( 0 ), imath .V3f ( 1 ) ) )
9696 if writeCs :
9797 boxA ["Cs" ] = IECoreScene .PrimitiveVariable (
@@ -278,7 +278,7 @@ def testAnimatedVisibility( self ):
278278
279279 # invisible
280280 self .assertEqual ( parentVisibility .Get ( 1012 ), "invisible" )
281-
281+
282282 # still invisible
283283 self .assertEqual ( parentVisibility .Get ( 1021 ), "invisible" )
284284
@@ -304,7 +304,7 @@ def testAnimatedVisibility( self ):
304304
305305 # invisible
306306 self .assertEqual ( parent .readAttribute ( IECoreScene .SceneInterface .visibilityName , 1012 / fps ).value , False )
307-
307+
308308 # still invisible
309309 self .assertEqual ( parent .readAttribute ( IECoreScene .SceneInterface .visibilityName , 1021 / fps ).value , False )
310310
@@ -326,7 +326,7 @@ def testTagsLoadedAsCollections( self ):
326326 t .writeTags ( ["t1" , "all" , "asset-(12)" ] )
327327 s .writeTags ( ["s1" , "all" , "asset-(12)" ] )
328328 del m , t , s
329-
329+
330330 # root
331331 stage = pxr .Usd .Stage .Open ( fileName )
332332 root = stage .GetPseudoRoot ()
@@ -431,17 +431,17 @@ def testDefaultPrimVars( self ):
431431 normalsData [0 ],
432432 pxr .Gf .Vec3f (0.0 , 0.0 , - 1.0 )
433433 )
434-
434+
435435 self .assertEqual (
436436 normalsData [8 ],
437437 pxr .Gf .Vec3f (0.0 , 0.0 , 1.0 )
438438 )
439-
439+
440440 self .assertEqual (
441441 normalsData [16 ],
442442 pxr .Gf .Vec3f (0.0 , 1.0 , 0.0 )
443443 )
444-
444+
445445 self .assertEqual (
446446 normalsData [23 ],
447447 pxr .Gf .Vec3f (0.0 , - 1.0 , 0.0 )
@@ -454,12 +454,12 @@ def testDefaultPrimVars( self ):
454454 uvsData [0 ],
455455 pxr .Gf .Vec2f (0.375 , 0.0 )
456456 )
457-
457+
458458 self .assertEqual (
459459 uvsData [8 ],
460460 pxr .Gf .Vec2f (0.375 , 1.0 )
461461 )
462-
462+
463463 self .assertEqual (
464464 uvsData [12 ],
465465 pxr .Gf .Vec2f (0.125 , .25 )
@@ -544,7 +544,7 @@ def testCustomPrimvars( self ):
544544
545545 # interpolation
546546 self .assertEqual ( customPoint .GetMetadata ( "interpolation" ), "vertex" )
547-
547+
548548 # value
549549 self .assertEqual ( customPoint .Get ( 24.0 ), pxr .Vt .Vec3fArray ( 1 , [ pxr .Gf .Vec3f ( 12 ) ] ) )
550550
@@ -645,7 +645,7 @@ def testCornersAndCreases( self ):
645645
646646 # crease indices
647647 self .assertEqual ( mesh .creaseIds (), IECore .IntVectorData ( [ 0 , 1 , 2 ] ) )
648-
648+
649649 # crease sharpness
650650 self .assertEqual ( mesh .creaseSharpnesses ()[0 ], 4.0 )
651651
@@ -693,7 +693,7 @@ def testPointsPrimitive( self ):
693693
694694 points = location .readObject ( 1.0 )
695695 pointsData = points ["P" ].data
696-
696+
697697 self .assertEqual ( pointsData [0 ], imath .V3f ( 1 , 2 , 3 ) )
698698 self .assertEqual ( pointsData [1 ], imath .V3f ( 12 , 13 , 14 ) )
699699
@@ -712,7 +712,7 @@ def testCurvesPrimitive( self ):
712712 "catmullRom" : IECore .CubicBasisf .catmullRom (),
713713 "linear" : IECore .CubicBasisf .linear (),
714714 "bezier" : IECore .CubicBasisf .bezier (),
715-
715+
716716 }
717717
718718 children = []
@@ -1046,7 +1046,7 @@ def testLinksTimeOffset( self ):
10461046 fps = 24.0
10471047 fileName = os .path .join ( self .temporaryDirectory (), "testUSDTimeOffsetLinked.scc" )
10481048 self ._writeScene ( fileName , transformRootChildren = True )
1049-
1049+
10501050 for start , end in ( ( 0.5 , 2.0 ), ( 1.5 , 2.5 ), ( 1.0 , 1.5 ) ):
10511051 linkedScene = IECoreScene .SharedSceneInterfaces .get ( fileName )
10521052 linkFileName = "{}/testUSDTimeOffsetLink_{}_{}.lscc" .format ( self .temporaryDirectory (), start , end )
@@ -1057,7 +1057,7 @@ def testLinksTimeOffset( self ):
10571057
10581058 linkedOffset .writeAttribute ( IECoreScene .LinkedScene .linkAttribute , linkDataA , start )
10591059 linkedOffset .writeAttribute ( IECoreScene .LinkedScene .linkAttribute , linkDataB , end )
1060-
1060+
10611061 noTimeOffset = l .createChild ( "linked" )
10621062 noTimeOffset .writeLink ( linkedScene )
10631063
@@ -1134,7 +1134,7 @@ def testWriteTimeSamplesWitinFrameRange( self ):
11341134 }
11351135
11361136 stage .Export ( fileName , args = args )
1137-
1137+
11381138 scene = IECoreScene .SharedSceneInterfaces .get ( fileName )
11391139 sphere = scene .child ( "Sphere" )
11401140
0 commit comments