MCPcopy Create free account
hub / github.com/ImageEngine/cortex / hash

Method hash

src/IECoreScene/LinkedScene.cpp:1423–1475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1421}
1422
1423void LinkedScene::hash( HashType hashType, double time, MurmurHash &h ) const
1424{
1425 if ( !m_readOnly )
1426 {
1427 throw Exception( "Hashes not available on write-only LinkedScene!" );
1428 }
1429
1430 if ( m_linkedScene )
1431 {
1432 if ( m_atLink )
1433 {
1434 /// special cases: we are exactly at the entry point for the linked scene.
1435 switch( hashType )
1436 {
1437 case TransformHash:
1438 mainSceneHash( hashType, time, h );
1439 // Link locations override the transform and bound, so we return without adding the hash from the linked scene.
1440 return;
1441 case AttributesHash:
1442 case HierarchyHash:
1443 case ChildNamesHash:
1444 // Attributes, ChildNames and Hierarchy are affected by both the main scene and the linked scene
1445 mainSceneHash( hashType, time, h );
1446 break;
1447 case ObjectHash:
1448 // Let the object come from the linked location:
1449 break;
1450 case BoundHash:
1451 // if there are extra children at the link, we have to read the bound directly from the main scene,
1452 // so we hash from there and return (which isn't particularly smart at the moment, so it's going to look
1453 // like all bounds are different when maybe they aren't). Otherwise we get the bound hash from m_linkedScene
1454 // so we can recognize repetition.
1455 NameList childNames;
1456 m_mainScene->childNames( childNames );
1457 if( childNames.size() )
1458 {
1459 mainSceneHash( hashType, time, h );
1460 return;
1461 }
1462 break;
1463 };
1464 }
1465 if ( m_timeRemapped )
1466 {
1467 time = remappedLinkTime( time );
1468 }
1469 m_linkedScene->hash(hashType, time, h);
1470 }
1471 else
1472 {
1473 mainSceneHash(hashType, time, h);
1474 }
1475}
1476
1477/// serialise this into the linked scene cache so it can just be loaded directly without having to traverse the entire scene
1478IECore::PathMatcher LinkedScene::linkLocations() const

Callers 1

mainSceneHashMethod · 0.45

Calls 2

childNamesMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected