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

Method load

src/IECoreScene/ShaderNetwork.cpp:538–569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536 }
537
538 void load( IECore::Object::LoadContextPtr context )
539 {
540 unsigned int v = g_ioVersion;
541 ConstIndexedIOPtr container = context->container( staticTypeName(), v );
542
543 ConstIndexedIOPtr shaders = container->subdirectory( "shaders" );
544 IndexedIO::EntryIDList handles;
545 shaders->entryIds( handles, IndexedIO::Directory );
546 for( const auto &handle : handles )
547 {
548 ShaderPtr shader = context->load<Shader>( shaders.get(), handle );
549 setShader( handle, shader.get() );
550 }
551
552 ConstIndexedIOPtr connections = container->subdirectory( "connections" );
553 IndexedIO::EntryIDList connectionIndices;
554 connections->entryIds( connectionIndices );
555 for( const auto &connectionIndex : connectionIndices )
556 {
557 InternedString c[4];
558 InternedString *cp = c;
559 connections->read( connectionIndex, cp, 4 );
560 addConnection(
561 Connection( Parameter( cp[0], cp[1] ), Parameter( cp[2], cp[3] ) )
562 );
563 }
564
565 InternedString o[2];
566 InternedString *op = o;
567 container->read( "output", op, 2 );
568 m_output = Parameter( op[0], op[1] );
569 }
570
571 void memoryUsage( IECore::Object::MemoryAccumulator &accumulator ) const
572 {

Callers

nothing calls this directly

Calls 8

setShaderFunction · 0.85
ConnectionFunction · 0.85
ParameterFunction · 0.85
containerMethod · 0.80
subdirectoryMethod · 0.80
entryIdsMethod · 0.45
getMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected