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

Method doFlush

src/IECoreScene/SceneCache.cpp:1778–2030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1776 }
1777
1778 void doFlush()
1779 {
1780 IndexedIOPtr io;
1781 // save the transform sample times
1782 if ( m_transformSampleTimes.size() )
1783 {
1784 io = m_indexedIO->subdirectory( transformEntry, IndexedIO::CreateIfMissing );
1785 storeSampleTimes( m_transformSampleTimes, io );
1786 }
1787
1788 // detect if topology or prim vars are animated
1789 if ( !m_objectSampleTimes.empty() )
1790 {
1791 if ( m_animatedObjectTopology.second )
1792 {
1793 writeAttribute( animatedObjectTopologyAttribute, new BoolData( true ), 0 );
1794 }
1795 else
1796 {
1797 InternedStringVectorDataPtr primVarData = new InternedStringVectorData();
1798 std::vector<InternedString> &primVars = primVarData->writable();
1799 for ( AnimatedPrimVarMap::iterator it = m_animatedObjectPrimVars.begin(); it != m_animatedObjectPrimVars.end(); ++it )
1800 {
1801 if ( it->second.second )
1802 {
1803 primVars.push_back( it->first );
1804 }
1805 }
1806
1807 writeAttribute( animatedObjectPrimVarsAttribute, primVarData.get(), 0 );
1808 }
1809 }
1810
1811 // save the attribute sample times
1812 if ( m_attributeSampleTimes.size() )
1813 {
1814 io = m_indexedIO->subdirectory( attributesEntry, IndexedIO::CreateIfMissing );
1815 for ( AttributeSamplesMap::const_iterator it = m_attributeSampleTimes.begin(); it != m_attributeSampleTimes.end(); it++ )
1816 {
1817 storeSampleTimes( it->second, io->subdirectory( it->first, IndexedIO::CreateIfMissing ) );
1818 }
1819 }
1820 // save the object sample times
1821 if ( m_objectSampleTimes.size() )
1822 {
1823 io = m_indexedIO->subdirectory( objectEntry, IndexedIO::CreateIfMissing );
1824 storeSampleTimes( m_objectSampleTimes, io );
1825 }
1826
1827 // We have to compute the bounding box over time for the object and each child.
1828 for ( std::map< SceneCache::Name, WriterImplementationPtr >::const_iterator cit = m_children.begin(); cit != m_children.end(); cit++ )
1829 {
1830 const SampleTimes &childBoundTimes = cit->second->m_boundSampleTimes;
1831 const BoxSamples &childBoxSamples = cit->second->m_boundSamples;
1832 const SampleTimes &childTransformTimes = cit->second->m_transformSampleTimes;
1833 const TransformSamples &childTransformSamples = cit->second->m_transformSamples;
1834
1835 if ( childBoundTimes.size() == 0 )

Callers

nothing calls this directly

Calls 15

readTagsFunction · 0.85
subdirectoryMethod · 0.80
writeChildSetsMethod · 0.80
typeIdMethod · 0.80
sizeMethod · 0.45
writableMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45
resizeMethod · 0.45
writeMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected