Import/export of embedded texture names for the glTF/glTF2 format
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user