| 422 | } |
| 423 | |
| 424 | void ObjectMeshHolder::copyTextureAndColors( const ObjectMeshHolder & src, const VertMap & thisToSrc, const FaceMap & thisToSrcFaces ) |
| 425 | { |
| 426 | MR_TIMER; |
| 427 | copyColors( src, thisToSrc, thisToSrcFaces ); |
| 428 | setTextures( src.getTextures() ); |
| 429 | |
| 430 | const auto& srcTexPerFace = src.getTexturePerFace(); |
| 431 | if ( !srcTexPerFace.empty() ) |
| 432 | { |
| 433 | TexturePerFace texPerFace; |
| 434 | texPerFace.resizeNoInit( thisToSrcFaces.size() ); |
| 435 | ParallelFor( texPerFace, [&] ( FaceId id ) |
| 436 | { |
| 437 | texPerFace[id] = srcTexPerFace[thisToSrcFaces[id]]; |
| 438 | } ); |
| 439 | setTexturePerFace( std::move( texPerFace ) ); |
| 440 | } |
| 441 | |
| 442 | const auto& srcUVCoords = src.getUVCoords(); |
| 443 | const auto lastVert = src.mesh()->topology.lastValidVert(); |
| 444 | const bool updateUV = lastVert < srcUVCoords.size(); |
| 445 | |
| 446 | if ( !updateUV ) |
| 447 | return; |
| 448 | |
| 449 | VertUVCoords uvCoords; |
| 450 | uvCoords.resizeNoInit( thisToSrc.size() ); |
| 451 | ParallelFor( uvCoords, [&]( VertId id ) |
| 452 | { |
| 453 | uvCoords[id] = srcUVCoords[thisToSrc[id]]; |
| 454 | } ); |
| 455 | |
| 456 | setUVCoords( std::move( uvCoords ) ); |
| 457 | } |
| 458 | |
| 459 | void ObjectMeshHolder::copyColors( const ObjectMeshHolder& src, const VertMap& thisToSrc, const FaceMap& thisToSrcFaces ) |
| 460 | { |
no test coverage detected