( self )
| 48 | VDBTestCase.setUp( self ) |
| 49 | |
| 50 | def testCanLoadVDBFromFile( self ) : |
| 51 | sourcePath = os.path.join( self.dataDir, "sphere.vdb" ) |
| 52 | vdbObject = IECoreVDB.VDBObject( sourcePath ) |
| 53 | |
| 54 | gridNames = vdbObject.gridNames() |
| 55 | self.assertEqual(gridNames, ['ls_sphere']) |
| 56 | |
| 57 | metadata = vdbObject.metadata('ls_sphere') |
| 58 | |
| 59 | # skip the file size |
| 60 | del metadata['file_mem_bytes'] |
| 61 | |
| 62 | expected = IECore.CompoundObject( |
| 63 | { |
| 64 | 'name': IECore.StringData( 'ls_sphere' ), |
| 65 | 'file_voxel_count': IECore.Int64Data( 270638 ), |
| 66 | 'file_bbox_min': IECore.V3iData( imath.V3i( -62, -62, -62 ) ), |
| 67 | 'file_bbox_max': IECore.V3iData( imath.V3i( 62, 62, 62 ) ), |
| 68 | 'is_local_space': IECore.BoolData( 0 ), |
| 69 | 'is_saved_as_half_float': IECore.BoolData( 1 ), |
| 70 | 'value_type': IECore.StringData( 'float' ), |
| 71 | 'class': IECore.StringData( 'level set' ), |
| 72 | #'file_mem_bytes': IECore.Int64Data( 2643448 ), |
| 73 | 'vector_type': IECore.StringData( 'invariant' ) |
| 74 | } |
| 75 | ) |
| 76 | |
| 77 | self.assertEqual( metadata, expected ) |
| 78 | |
| 79 | def testCanReadDoubleMetadata( self ) : |
| 80 | sourcePath = os.path.join( self.dataDir, "sphere.vdb" ) |
nothing calls this directly
no test coverage detected