Skip to content

Commit 7af432e

Browse files
authored
Merge pull request #1314 from johnhaddon/vdbEqualityFix
VDBObject : Fix infinite recursion in `isEqualTo()`
2 parents ae12566 + 97f885b commit 7af432e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/IECoreVDB/VDBObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ IECore::CompoundObjectPtr VDBObject::metadata( const std::string &name )
286286

287287
bool VDBObject::isEqualTo( const IECore::Object *other ) const
288288
{
289-
if( !IECoreScene::VisibleRenderable::isNotEqualTo( other ) )
289+
if( !IECoreScene::VisibleRenderable::isEqualTo( other ) )
290290
{
291291
return false;
292292
}

test/IECoreVDB/VDBObjectTest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,16 @@ def testFilename( self ) :
260260
emptyVDB = IECoreVDB.VDBObject()
261261
self.assertEqual( emptyVDB.fileName(), "" )
262262

263+
def testEquality( self ) :
264+
265+
o = IECoreVDB.VDBObject( os.path.join( self.dataDir, "smoke.vdb" ) )
266+
self.assertEqual( o, o )
267+
268+
o2 = o.copy()
269+
o2.findGrid( "density" ).mapAll( lambda value : value + 1 )
270+
271+
self.assertNotEqual( o2, o )
272+
self.assertEqual( o2, o2 )
263273

264274
if __name__ == "__main__":
265275
unittest.main()

0 commit comments

Comments
 (0)