| 120 | } |
| 121 | |
| 122 | void 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 | |
| 140 | namespace |
| 141 | { |