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

Method save

src/IECoreScene/Primitive.cpp:122–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122void Primitive::save( IECore::Object::SaveContext *context ) const
123{
124 VisibleRenderable::save( context );
125 IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion );
126 IndexedIOPtr ioVariables = container->subdirectory( g_variablesEntry, IndexedIO::CreateIfMissing );
127 for( PrimitiveVariableMap::const_iterator it=variables.begin(); it!=variables.end(); it++ )
128 {
129 IndexedIOPtr ioPrimVar = ioVariables->subdirectory( it->first, IndexedIO::CreateIfMissing );
130 const int i = it->second.interpolation;
131 ioPrimVar->write( g_interpolationEntry, i );
132 context->save( it->second.data.get(), ioPrimVar.get(), g_dataEntry );
133 if( it->second.indices )
134 {
135 context->save( it->second.indices.get(), ioPrimVar.get(), g_indicesEntry );
136 }
137 }
138}
139
140namespace
141{

Callers

nothing calls this directly

Calls 6

containerMethod · 0.80
subdirectoryMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
writeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected