diff --git a/src/IECoreVDB/VDBObject.cpp b/src/IECoreVDB/VDBObject.cpp index c96cfea9c2..8a3d8244e0 100644 --- a/src/IECoreVDB/VDBObject.cpp +++ b/src/IECoreVDB/VDBObject.cpp @@ -286,7 +286,7 @@ IECore::CompoundObjectPtr VDBObject::metadata( const std::string &name ) bool VDBObject::isEqualTo( const IECore::Object *other ) const { - if( !IECoreScene::VisibleRenderable::isNotEqualTo( other ) ) + if( !IECoreScene::VisibleRenderable::isEqualTo( other ) ) { return false; } diff --git a/test/IECoreVDB/VDBObjectTest.py b/test/IECoreVDB/VDBObjectTest.py index 7b15fede6e..a43aa316c4 100644 --- a/test/IECoreVDB/VDBObjectTest.py +++ b/test/IECoreVDB/VDBObjectTest.py @@ -260,6 +260,16 @@ def testFilename( self ) : emptyVDB = IECoreVDB.VDBObject() self.assertEqual( emptyVDB.fileName(), "" ) + def testEquality( self ) : + + o = IECoreVDB.VDBObject( os.path.join( self.dataDir, "smoke.vdb" ) ) + self.assertEqual( o, o ) + + o2 = o.copy() + o2.findGrid( "density" ).mapAll( lambda value : value + 1 ) + + self.assertNotEqual( o2, o ) + self.assertEqual( o2, o2 ) if __name__ == "__main__": unittest.main()