void BranchCreator::hashBranchChildNames( const ScenePath &parentPath, const ScenePath &branchPath, const Gaffer::Context *context, IECore::MurmurHash &h ) const { const InternedStringVectorData *fullPathData = context->get<InternedStringVectorData>( ScenePlug::scenePathContextName, NULL ); if( fullPathData ) { // In the common case, the full path is in the context already (and we just decomposed it // into parentPath and branchPath for the convenience of derived classes). SceneProcessor::hashChildNames( fullPathData->readable(), context, inPlug(), h ); } else { // In the rare case that we're being called from from our own globals computation // via hashMapping(), the full path isn't in the context, so we need to // construct it ourselves. ScenePath fullPath( parentPath ); fullPath.insert( fullPath.end(), branchPath.begin(), branchPath.end() ); SceneProcessor::hashChildNames( fullPath, context, inPlug(), h ); } }
Gaffer::ContextPtr Instancer::instanceContext( const Gaffer::Context *parentContext, const ScenePath &branchPath ) const { if( branchPath.size() == 0 ) { return 0; } ContextPtr result = new Context( *parentContext ); InternedStringVectorDataPtr instancePath = new InternedStringVectorData; instancePath->writable().insert( instancePath->writable().end(), branchPath.begin() + 1, branchPath.end() ); result->set( ScenePlug::scenePathContextName, instancePath.get() ); result->set( "instancer:id", instanceIndex( branchPath ) ); return result; }
void Duplicate::sourcePath( const ScenePath &branchPath, ScenePath &source ) const { assert( branchPath.size() ); ScenePlug::stringToPath( targetPlug()->getValue(), source ); copy( ++branchPath.begin(), branchPath.end(), back_inserter( source ) ); }