Skip to content

Commit

Permalink
fixup! OSL Expressions : Support vector types in context
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmehl committed Oct 27, 2023
1 parent 0fe65b4 commit 44eb72a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/GafferOSLTest/OSLExpressionEngineTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,31 +294,31 @@ def testContextVectorTypes( self ) :
c["f"] = IECore.FloatVectorData( [ 10, 11 ] )
c["i"] = IECore.IntVectorData( [ 11, 12 ] )
c["c"] = IECore.Color3fVectorData( [ imath.Color3f( 10, 11, 12 ), imath.Color3f( 13, 14, 15 ) ] )
# # c["v"] = IECore.V3fVectorData( [ imath.V3f( 9, 10, 11 ), imath.V3f( 12, 13, 14 ) ] )
c["v"] = IECore.V3fVectorData( [ imath.V3f( 9, 10, 11 ), imath.V3f( 12, 13, 14 ) ] )
c["s"] = IECore.StringVectorData( [ "non-default0", "non-default1" ] )

self.assertEqual( s["n"]["user"]["f0"].getValue(), 10 )
self.assertEqual( s["n"]["user"]["i0"].getValue(), 11 )
self.assertEqual( s["n"]["user"]["c0"].getValue(), imath.Color3f( 10, 11, 12 ) )
# self.assertEqual( s["n"]["user"]["v0"].getValue(), imath.V3f( 9, 10, 11 ) )
self.assertEqual( s["n"]["user"]["v0"].getValue(), imath.V3f( 9, 10, 11 ) )
self.assertEqual( s["n"]["user"]["s0"].getValue(), "non-default0" )

self.assertEqual( s["n"]["user"]["f1"].getValue(), 11 )
self.assertEqual( s["n"]["user"]["i1"].getValue(), 12 )
self.assertEqual( s["n"]["user"]["c1"].getValue(), imath.Color3f( 13, 14, 15 ) )
# self.assertEqual( s["n"]["user"]["v1"].getValue(), imath.V3f( 12, 13, 14 ) )
self.assertEqual( s["n"]["user"]["v1"].getValue(), imath.V3f( 12, 13, 14 ) )
self.assertEqual( s["n"]["user"]["s1"].getValue(), "non-default1" )

self.assertEqual( s["n"]["user"]["f2"].getValue(), 3 )
self.assertEqual( s["n"]["user"]["i2"].getValue(), 3 )
self.assertEqual( s["n"]["user"]["c2"].getValue(), imath.Color3f( 7, 8, 9 ) )
# self.assertEqual( s["n"]["user"]["v2"].getValue(), imath.V3f( 6, 7, 8 ) )
self.assertEqual( s["n"]["user"]["v2"].getValue(), imath.V3f( 6, 7, 8 ) )
self.assertEqual( s["n"]["user"]["s2"].getValue(), "default2" )

self.assertEqual( s["n"]["user"]["f3"].getValue(), 11 )
self.assertEqual( s["n"]["user"]["i3"].getValue(), 12 )
self.assertEqual( s["n"]["user"]["c3"].getValue(), imath.Color3f( 13, 14, 15 ) )
# self.assertEqual( s["n"]["user"]["v3"].getValue(), imath.V3f( 12, 13, 14 ) )
self.assertEqual( s["n"]["user"]["v3"].getValue(), imath.V3f( 12, 13, 14 ) )
self.assertEqual( s["n"]["user"]["s3"].getValue(), "non-default1" )

def testScenePathContext( self ) :
Expand Down

0 comments on commit 44eb72a

Please sign in to comment.