|
39 | 39 | import shutil |
40 | 40 | import os |
41 | 41 | import tempfile |
| 42 | +import pathlib |
42 | 43 |
|
43 | 44 | import IECore |
44 | 45 | import IECoreScene |
@@ -1200,6 +1201,40 @@ def testObjectVectorShaderCompatibility( self ) : |
1200 | 1201 | for a in nonShaderAttributes : |
1201 | 1202 | self.assertEqual( c.readAttribute( a, 0 ), objectVector ) |
1202 | 1203 |
|
| 1204 | + def testDeprecatedSplines( self ) : |
| 1205 | + |
| 1206 | + fileName = pathlib.Path( __file__ ).parent / "data" / "oldSplines.scc" |
| 1207 | + root = IECoreScene.SceneInterface.create( str( fileName ), IECore.IndexedIO.OpenMode.Read ) |
| 1208 | + child = root.child( "cube" ) |
| 1209 | + |
| 1210 | + shaderNetwork = child.readAttribute( "ai:surface", 0 ) |
| 1211 | + self.assertEqual( |
| 1212 | + shaderNetwork.getShader( "ColorSpline" ).parameters["spline"], |
| 1213 | + IECore.SplinefColor3fData( IECore.SplinefColor3f( |
| 1214 | + IECore.CubicBasisf.linear(), |
| 1215 | + ( |
| 1216 | + ( 0, imath.Color3f( 0, 0, 0 ) ), |
| 1217 | + ( 0.4, imath.Color3f( 0.3, 0.5, 0.9 ) ), |
| 1218 | + ( 0.7, imath.Color3f( 0.8, 0.7, 0.3) ), |
| 1219 | + ( 1, imath.Color3f( 1, 1, 1 ) ) |
| 1220 | + ) |
| 1221 | + ) ) |
| 1222 | + ) |
| 1223 | + |
| 1224 | + self.assertEqual( |
| 1225 | + shaderNetwork.getShader( "FloatSpline" ).parameters["spline"], |
| 1226 | + IECore.SplineffData(IECore.Splineff( |
| 1227 | + IECore.CubicBasisf.bSpline(), |
| 1228 | + ( |
| 1229 | + ( 0, 0 ), ( 0, 0 ), ( 0, 0 ), |
| 1230 | + ( 0.3, 0.8 ), |
| 1231 | + ( 0.7, 0.7 ), |
| 1232 | + ( 0.9, 0.1 ), |
| 1233 | + ( 1, 1 ), ( 1, 1 ), ( 1, 1 ) |
| 1234 | + ) |
| 1235 | + ) ) |
| 1236 | + ) |
| 1237 | + |
1203 | 1238 | def testCopyReturnValues( self ): |
1204 | 1239 |
|
1205 | 1240 | fileName = os.path.join( self.tempDir, "test.scc" ) |
|
0 commit comments