| 79 | namespace { |
| 80 | |
| 81 | void SetMaterialColorProperty(const std::vector<int> &embeddedTexIdxs, Asset &, TexProperty prop, aiMaterial *mat, |
| 82 | aiTextureType texType, const char *pKey, unsigned int type, unsigned int idx) { |
| 83 | if (prop.texture) { |
| 84 | if (prop.texture->source) { |
| 85 | aiString uri(prop.texture->source->uri); |
| 86 | |
| 87 | if (const int texIdx = embeddedTexIdxs[prop.texture->source.GetIndex()]; texIdx != -1) { // embedded |
| 88 | // setup texture reference string (copied from ColladaLoader::FindFilenameForEffectTexture) |
| 89 | uri.data[0] = '*'; |
| 90 | uri.length = 1 + ASSIMP_itoa10(uri.data + 1, AI_MAXLEN - 1, texIdx); |
| 91 | } |
| 92 | |
| 93 | mat->AddProperty(&uri, _AI_MATKEY_TEXTURE_BASE, texType, 0); |
| 94 | } |
| 95 | return; |
| 96 | } |
| 97 | |
| 98 | aiColor4D col; |
| 99 | CopyValue(prop.color, col); |
| 100 | mat->AddProperty(&col, 1, pKey, type, idx); |
| 101 | } |
| 102 | |
| 103 | void SetFace(aiFace &face, int a) { |
| 104 | face.mNumIndices = 1; |
no test coverage detected