| 184 | } |
| 185 | |
| 186 | void remapToLegacyVariableNames( const IndexedIO::EntryIDList &requested, const IndexedIO::EntryIDList &existing, IndexedIO::EntryIDList &result ) |
| 187 | { |
| 188 | result.clear(); |
| 189 | |
| 190 | IndexedIO::EntryIDList extraUVs; |
| 191 | for( const auto &existingName : existing ) |
| 192 | { |
| 193 | if( boost::ends_with( existingName.string(), "_s" ) || boost::ends_with( existingName.string(), "_t" ) ) |
| 194 | { |
| 195 | extraUVs.push_back( existingName.string().substr( 0, existingName.string().length() - 2 ) ); |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | for( const auto &name : requested ) |
| 200 | { |
| 201 | if( name == "uv" ) |
| 202 | { |
| 203 | result.push_back( "s" ); |
| 204 | result.push_back( "t" ); |
| 205 | result.push_back( "stIndices" ); |
| 206 | } |
| 207 | else if( std::find( extraUVs.begin(), extraUVs.end(), name ) != extraUVs.end() ) |
| 208 | { |
| 209 | result.push_back( name.string() + "_s" ); |
| 210 | result.push_back( name.string() + "_t" ); |
| 211 | result.push_back( name.string() + "Indices" ); |
| 212 | } |
| 213 | else |
| 214 | { |
| 215 | result.push_back( name ); |
| 216 | } |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | void convertLegacyVariables( PrimitiveVariableMap &variables ) |
| 221 | { |
no test coverage detected