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

Method load

src/IECoreScene/Primitive.cpp:355–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353} // namespace
354
355void Primitive::load( IECore::Object::LoadContextPtr context )
356{
357 unsigned int v = m_ioVersion;
358 ConstIndexedIOPtr container = context->container( staticTypeName(), v );
359
360 // we changed the inheritance hierarchy at io version 1
361 if( v==0 )
362 {
363 Renderable::load( context );
364 }
365 else
366 {
367 VisibleRenderable::load( context );
368 }
369
370 ConstIndexedIOPtr ioVariables = container->subdirectory( g_variablesEntry );
371
372 const Canceller *canceller = context->canceller();
373
374 variables.clear();
375 IndexedIO::EntryIDList names;
376 ioVariables->entryIds( names, IndexedIO::Directory );
377 IndexedIO::EntryIDList::const_iterator it;
378 for( it=names.begin(); it!=names.end(); it++ )
379 {
380 ConstIndexedIOPtr ioPrimVar = ioVariables->subdirectory( *it );
381 int i;
382 ioPrimVar->read( g_interpolationEntry, i );
383
384 Canceller::check( canceller );
385 IntVectorDataPtr indices = nullptr;
386 if( ioPrimVar->hasEntry( g_indicesEntry ) )
387 {
388 indices = context->load<IntVectorData>( ioPrimVar.get(), g_indicesEntry );
389 }
390
391 Canceller::check( canceller );
392 variables.insert(
393 PrimitiveVariableMap::value_type( *it, PrimitiveVariable( (PrimitiveVariable::Interpolation)i, context->load<Data>( ioPrimVar.get(), g_dataEntry ), indices ) )
394 );
395 }
396
397 if( v < 2 )
398 {
399 ::convertLegacyVariables( variables );
400 }
401}
402
403PrimitiveVariableMap Primitive::loadPrimitiveVariables( const IndexedIO *ioInterface, const IndexedIO::EntryID &name, const IndexedIO::EntryIDList &primVarNames, const Canceller *canceller )
404{

Callers

nothing calls this directly

Calls 12

PrimitiveVariableFunction · 0.85
convertLegacyVariablesFunction · 0.85
containerMethod · 0.80
subdirectoryMethod · 0.80
hasEntryMethod · 0.80
insertMethod · 0.80
clearMethod · 0.45
entryIdsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
readMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected