Skip to content

Commit

Permalink
Merge branch 'master' of github.com:KhronosGroup/COLLADA2GLTF into fi…
Browse files Browse the repository at this point in the history
…x-no-image-reference
  • Loading branch information
lasalvavida committed Apr 22, 2018
2 parents a9b490f + 08447f5 commit ccc65a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Change Log

##### Fixes :wrench:
* Upgrade to Draco 1.2.5 [#179](https://github.com/KhronosGroup/COLLADA2GLTF/pull/179)
* Fix issue with exporting normal maps [#182](https://github.com/KhronosGroup/COLLADA2GLTF/pull/182)

### v2.1.1 - 2018-04-04

Expand Down
9 changes: 8 additions & 1 deletion GLTF/src/GLTFAsset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ std::vector<GLTF::Texture*> GLTF::Asset::getAllTextures() {
uniqueTextures.insert(values->specularTexture);
}
}
if (values->bumpTexture != NULL) {
if (uniqueTextures.find(values->bumpTexture) == uniqueTextures.end()) {
textures.push_back(values->bumpTexture);
uniqueTextures.insert(values->bumpTexture);
}
}
}
else if (material->type == GLTF::Material::PBR_METALLIC_ROUGHNESS) {
GLTF::MaterialPBR* materialPBR = (GLTF::MaterialPBR*)material;
Expand Down Expand Up @@ -419,7 +425,8 @@ void GLTF::Asset::removeUnusedSemantics() {
if (semantic.find("TEXCOORD") != std::string::npos) {
std::map<std::string, GLTF::Accessor*>::iterator removeTexcoord = primitive->attributes.find(semantic);
if (semantic == "TEXCOORD_0") {
if (values->ambientTexture == NULL && values->diffuseTexture == NULL && values->emissionTexture == NULL && values->specularTexture == NULL) {
if (values->ambientTexture == NULL && values->diffuseTexture == NULL && values->emissionTexture == NULL &&
values->specularTexture == NULL && values->bumpTexture == NULL) {
std::map<std::string, GLTF::Accessor*>::iterator removeTexcoord = primitive->attributes.find(semantic);
primitive->attributes.erase(removeTexcoord);
removeAttributeFromDracoExtension(primitive, semantic);
Expand Down

0 comments on commit ccc65a3

Please sign in to comment.