| 604 | { |
| 605 | |
| 606 | ShaderNetwork::Parameter convertComponentSuffix( const ShaderNetwork::Parameter ¶meter, const std::string &suffix ) |
| 607 | { |
| 608 | int index; |
| 609 | auto it = find( begin( g_vectorComponents ), end( g_vectorComponents ), suffix ); |
| 610 | if( it != end( g_vectorComponents ) ) |
| 611 | { |
| 612 | index = it - begin( g_vectorComponents ); |
| 613 | } |
| 614 | else |
| 615 | { |
| 616 | auto cIt = find( begin( g_colorComponents ), end( g_colorComponents ), suffix ); |
| 617 | assert( cIt != end( g_colorComponents ) ); |
| 618 | index = cIt - begin( g_colorComponents ); |
| 619 | } |
| 620 | |
| 621 | return ShaderNetwork::Parameter( |
| 622 | parameter.shader, |
| 623 | boost::replace_last_copy( parameter.name.string(), "." + suffix, "[" + to_string( index ) + "]" ) |
| 624 | ); |
| 625 | } |
| 626 | |
| 627 | void convertOSLComponentConnections( ShaderNetwork *network, int oslVersion ) |
| 628 | { |
no test coverage detected