Import/export of embedded texture names for the glTF/glTF2 format

This commit is contained in:
Loïc
2020-01-29 14:04:41 +01:00
parent 26179cd4d2
commit 194d31002d
4 changed files with 6 additions and 0 deletions
+2
View File
@@ -352,6 +352,8 @@ void glTFExporter::GetMatColorOrTex(const aiMaterial* mat, glTF::TexProperty& pr
if (path[0] == '*') { // embedded
aiTexture* tex = mScene->mTextures[atoi(&path[1])];
prop.texture->source->name = tex->mFilename.C_Str();
uint8_t* data = reinterpret_cast<uint8_t*>(tex->pcData);
prop.texture->source->SetData(data, tex->mWidth, *mAsset);